DuFraN Posted January 24, 2014 Share Posted January 24, 2014 Hola, tengo una duda sobre este evento, si uso "root2 el evento detectara cualquier player que haya muerto, como hago para que solo me detecte ami? addEventHandler("onPlayerWasted",root,Cuando_Muera) Link to comment
Alexs Posted January 24, 2014 Share Posted January 24, 2014 Revisa dentro de la función 'Cuando_Muera', si es que 'source' eres tu (Te podría servir 'getPlayerAccount', 'getAccountName', 'getPlayerName' o cualquier función que te pueda identificar). Link to comment
DuFraN Posted January 25, 2014 Author Share Posted January 25, 2014 (edited) Lo hice pero hay algo que no funciona, segun lo que te entendi :3 function ejemplo() if source == getPlayerName(source) then outputChatBox("Funciona" ,source,255,255,255,true) else outputChatBox("No funciona" ,source,255,255,255,true) end addEventHandler("onPlayerWasted",root,ejemplo) hice ese mismo ejemplo, no me da error en el debug ni nada pero, me aparece "no funciona" Edited January 25, 2014 by Guest Link to comment
Alexs Posted January 25, 2014 Share Posted January 25, 2014 'source' es un jugador, mientras que 'getPlayerName(source)' es un string. Prueba así: function ejemplo() if 'TU NOMBRE' == getPlayerName(source) then outputChatBox("Funciona" ,source,255,255,255,true) else outputChatBox("No funciona" ,source,255,255,255,true) end *Quizá te entendí mal y lo que quieres es que un código solo se ejecute en el jugador que murió sin afectar a los demás, en ese caso deberías utilizar 'onClientPlayerWasted' y comparar si 'source' en ese evento es igual a 'localPlayer'. Link to comment
DuFraN Posted January 25, 2014 Author Share Posted January 25, 2014 Gracias Alex , lo hice con onClientPlayerWasted como dijiste y utilice el trigger, gracias men Link to comment
Recommended Posts