ghost050 Posted February 1, 2012 Share 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. Link to comment
12p Posted February 1, 2012 Share Posted February 1, 2012 if getElementHealth == 0 then killTimer Link to comment
ghost050 Posted February 1, 2012 Author Share Posted February 1, 2012 No lo entiendo muy bien Link to comment
Castillo Posted February 1, 2012 Share Posted February 1, 2012 Postea la funcion "encenderZombie". Link to comment
ghost050 Posted February 1, 2012 Author Share 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 ) Link to comment
Castillo Posted February 1, 2012 Share 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 Link to comment
ghost050 Posted February 1, 2012 Author Share 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 Link to comment
Castillo Posted February 1, 2012 Share Posted February 1, 2012 Copia el script de nuevo y proba. Link to comment
ghost050 Posted February 1, 2012 Author Share Posted February 1, 2012 Ah, de 10 muchas gracias Link to comment
Recommended Posts