Jump to content

[Solucionado] onPlayerChat


Recommended Posts

Posted (edited)
addEventHandler("onChatMessage",root, 
    function (mensaje) 
        outputChatBox(tostring(mensaje),root,255,255,255,true) 
    end 
)        

[2014-06-27 16:02:51] Resource 'vDscript' changed while running, reloading and restarting 
[2014-06-27 16:02:51] Stopping vDscript 
[2014-06-27 16:02:51] New resource 'vDscript' loaded 
[2014-06-27 16:02:51] Resources: 1 loaded, 0 failed 
[2014-06-27 16:02:51] Starting vDscript 
[2014-06-27 16:02:51] ERROR: vDscript\xmlNodes.lua:96: C stack overflow 
[2014-06-27 16:02:51] vDscript build: 39 

Lo que intentçe hacer es que al "enviar un mensaje el jugador" quede en blanco, pero me da stack y nose como hacerlo :D

Edited by Guest
Posted · Hidden
Hidden

Eso pasa porque estas enviando un mensaje a la vez que se envia otro, lo que produce un stack overflow.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted · Hidden
Hidden

Si lo que intentas hacer es borrar el mensaje, entonces eso no es posible.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Si lo que intentas hacer es borrar el mensaje, entonces eso no es posible.

hmm, intento "coger" el mensaje del jugador y ponerlo de color blanco, como un playerTag, mas o menos :S

Posted · Hidden
Hidden

No podes hacer eso, al menos no con ese evento.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
aver si te entendi quieres hacer que el mensaje de chat este de otro color ?

exacto, por ejemplo

en vez de:

venad: hola

aparezca de otro color, por ejemplo:

venad: hola

Posted (edited) · Hidden
Hidden

prueva con esto haber no estoi seguro si es lo que quieres

function chat ( message, messageType ) 
    local r, g, b = getPlayerNametagColor ( source ) 
    local playerName = getPlayerName ( source ) 
    if ( messageType == 0 ) then 
                outputChatBox ( playerName ..": #0000ff".. message, root, r, g, b, true ) -- cambiale el color por el que quieres -- 
            cancelEvent ( ) 
    elseif ( messageType == 2 ) then  
        local playerTeam = getPlayerTeam ( source ) 
        local teams = getPlayersInTeam ( playerTeam )  
        for _, team in ipairs ( teams ) do  
            outputChatBox ( "(team)".. playerName ..": #ffffff".. message, team, r, g, b, true ) -- este es el chat por team tambien cambiale al color que quieres --  
        end 
        cancelEvent ( ) 
    end 
end 
addEventHandler ( "onPlayerChat", root, chat ) 

Edited by Guest
430x73_FFFFFF_FF9900_000000_000000.png
Posted · Hidden
Hidden

Eso no tiene sentido, ni tampoco es lo que el quiere.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted · Hidden
Hidden

lo he probado y me funciona bien lo que el quiere si no me equivoco es cambiar el color del mensaje y eso es lo que hace

430x73_FFFFFF_FF9900_000000_000000.png
Posted
prueva con esto haber no estoi seguro si es lo que quieres
function chat ( message, messageType ) 
    local r, g, b = getPlayerNametagColor ( source ) 
    local playerName = getPlayerName ( source ) 
    if ( messageType == 0 ) then 
                outputChatBox ( playerName ..": #0000ff".. message, root, r, g, b, true ) -- cambiale el color por el que quieres -- 
            cancelEvent ( ) 
    elseif ( messageType == 2 ) then  
        local playerTeam = getPlayerTeam ( source ) 
        local teams = getPlayersInTeam ( playerTeam )  
        for _, team in ipairs ( teams ) do  
            outputChatBox ( "(team)".. playerName ..": #ffffff".. message, team, r, g, b, true ) -- este es el chat por team tambien cambiale al color que quieres --  
        end 
        cancelEvent ( ) 
    end 
end 
addEventHandler ( "onPlayerChat", root, chat ) 

Perfecto, si, lo que queria era cambiar el color del mensaje

PD: integrado en la build 74-75(en la 75 la edite) de mi script ^^, no te preocupes, todos los que me ayudasteis tendreis creditos

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...