Alexs Posted May 6, 2012 Posted May 6, 2012 Hola a Todos, Hice este script: Server: function pocavida ( attacker, weapon, bodypart, loss ) local salud = getElementHealth ( source ) if (salud <= 15 ) then triggerClientEvent ( "crearimagen", source ) end end addEventHandler ( "onPlayerDamage", getRootElement (),pocavida ) Client: function imagen ( ) local imgd = guiCreateStaticImage(0,0,1,1,"dano.png",true) end addEvent( "crearimagen", true ) addEventHandler( "crearimagen", getRootElement (), imagen ) Y funciona Bien, pero cuando respawneo la imagen sigue ahi intente agregar esto al Client: function alaparecer ( ) destroyElement ( imgd ) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), alaparecer ) pero el Debugscript dice "Bad Argument" que puedo hacer o usar? Developer @ MYVAL
Edikosh998 Posted May 6, 2012 Posted May 6, 2012 triggerClientEvent ( source,"crearimagen", source ) WRS( World Racing Server) [server] = 8%
Alexs Posted May 6, 2012 Author Posted May 6, 2012 emm... el script si funciona, pero cuando respawneo quiero sacar la imagen... Developer @ MYVAL
Edikosh998 Posted May 6, 2012 Posted May 6, 2012 if isElement(imgd) then destroyElement(imgd) end WRS( World Racing Server) [server] = 8%
Alexs Posted May 6, 2012 Author Posted May 6, 2012 isElement dice si el argumento es un elemento, no si este esta activo... Developer @ MYVAL
Edikosh998 Posted May 6, 2012 Posted May 6, 2012 Aaaa ya me di cuenta... Le pusiste local a la variable imgd WRS( World Racing Server) [server] = 8%
Alexs Posted May 6, 2012 Author Posted May 6, 2012 Ahora funciono, pero por lo que veo "onClientPlayerDamage" no funciona con los zombies, buscare otro evento.. Developer @ MYVAL
Recommended Posts