ghost050 Posted February 1, 2012 Posted February 1, 2012 He creado esto para que los zombies se incendien con el tiempo: addEvent("cuandoUnZombieEsCreado",true) addEventHandler("cuandoUnZombieEsCreado",root, function () if ( getElementModel (source) == 287) then setTimer ( encenderZombie, 100, 0, source ) end end ) Esto me aparece en la consola: [01:19:45] WARNING: zombies\zombie_server.lua:698: Bad 'element' pointer @ 'setPedOnFire'(1) [01:19:45] WARNING: zombies\zombie_server.lua:698: Bad 'element' pointer @ 'setPedOnFire'(1) [01:19:45] WARNING: zombies\zombie_server.lua:698: Bad 'element' pointer @ 'setPedOnFire'(1) [01:19:45] WARNING: zombies\zombie_server.lua:698: Bad 'element' pointer @ 'setPedOnFire'(1) [01:19:45] WARNING: zombies\zombie_server.lua:698: Bad 'element' pointer @ 'setPedOnFire'(1) [01:19:45] WARNING: zombies\zombie_server.lua:698: Bad 'element' pointer @ 'setPedOnFire'(1) Es obvio que el error es que el "pirozombie" muere y no hay elemento para incendiar, pero, ¿Como lo soluciono? PD: La parte para que los zombies no pierdan vida ya la he arreglado.
Castillo Posted February 1, 2012 Posted February 1, 2012 Postea la funcion "encenderZombie". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
ghost050 Posted February 1, 2012 Author Posted February 1, 2012 Este guion lo hice durmiendome, deberia quedar asi: addEvent("cuandoUnZombieEsCreado",true) addEventHandler("cuandoUnZombieEsCreado",root, function () if ( getElementModel (source) == 287) then setTimer ( setPedOnFire, 100, 0, source, true ) end end )
Castillo Posted February 1, 2012 Posted February 1, 2012 local timers = {} addEvent("cuandoUnZombieEsCreado",true) addEventHandler("cuandoUnZombieEsCreado",root, function () if ( getElementModel (source) == 287) then timers[source] = setTimer ( encenderZombie, 100, 0, source ) end end ) function encenderZombie(zombie) if (isElement(zombie) and getElementHealth(zombie) > 0) then setPedOnFire(zombie, true) else if isTimer(timers[zombie]) then killTimer(timers[zombie]) end end end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
ghost050 Posted February 1, 2012 Author Posted February 1, 2012 (edited) Me sale esto en la consola mira: [17:24:20] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:20] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:20] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:21] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:21] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:21] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:21] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:21] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:21] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:21] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:21] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:21] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:21] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean [17:24:21] WARNING: zombies\zombie_server.lua:713: Bad 'element' pointer @ 'getElementHealth'(1) [17:24:21] ERROR: zombies\zombie_server.lua:713: attempt to compare number with boolean guion: function encenderZombie(zombie)--712 if (zombie and getElementHealth(zombie) > 0) then--713 setPedOnFire(zombie, true)--714 else--715 if isTimer(timers[zombie]) then--716 killTimer(timers[zombie])--717 end--718 end--719 end--720 Edited February 1, 2012 by Guest
Castillo Posted February 1, 2012 Posted February 1, 2012 Copia el script de nuevo y proba. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts