freakk Posted April 25, 2012 Share Posted April 25, 2012 Hello i want to know if anyone can help me set fire to zombies unlimited because the fire is extinguished I can not and nobody could help addEvent("onZombieCreated",true) addEventHandler("onZombieCreated",root, function () if (getElementModel (source) == 68) then setPedOnFire(source, true) SetTimer(setPedOnFire,1000, 0) end end) Link to comment
Axel Posted April 25, 2012 Share Posted April 25, 2012 I think this will work: for i,v in ipairs getElementsByType("ped") do if (getElementModel(v) == 68) then setPedOnFire(v,true) end end Next time use [ lua ] [ /lua ] tags. Link to comment
freakk Posted April 25, 2012 Author Share Posted April 25, 2012 No, you don't understand me. I want to set fire the zombies. But the fire is not extinguished. Link to comment
X-SHADOW Posted April 25, 2012 Share Posted April 25, 2012 isOnFire: true to set the ped on fire, false to extinguish any fire on him. Link to comment
arezu Posted April 25, 2012 Share Posted April 25, 2012 I think he means that the fire disappears after a certain amount of time. Link to comment
Renkon Posted April 25, 2012 Share Posted April 25, 2012 addEvent("onZombieCreated",true) addEventHandler("onZombieCreated",root, function () if (getElementModel (source) == 68) then setPedOnFire(source, true) SetTimer(function() setPedOnFire(source, false) ,1000, 0) end end) Link to comment
freakk Posted April 26, 2012 Author Share Posted April 26, 2012 don't works appear this in console: error zombie\zombie_server.lua:703:unexpected symbol near ´,´ Link to comment
DNL291 Posted April 26, 2012 Share Posted April 26, 2012 (edited) addEvent("onZombieCreated",true) addEventHandler("onZombieCreated",root, function () if (getElementModel (source) == 68) then setPedOnFire(source, true) SetTimer(function() setPedOnFire(source, false) ,1000, 0) end end) Lua is case sensitive. Edited April 26, 2012 by Guest Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 addEvent ( "onZombieCreated", true ) addEventHandler ( "onZombieCreated", root, function ( ) if ( getElementModel ( source ) == 68 ) then setPedOnFire ( source, true ) setTimer ( function ( thePed ) if ( thePed and isElement ( thePed ) ) then setPedOnFire ( thePed, true ) end end ,1000, 0, source ) end end ) Link to comment
freakk Posted April 26, 2012 Author Share Posted April 26, 2012 yes!!! this works! thank you very much!! Now one last question please: i have a problem with the zombies onfire...these die alone. but i try this: addEventHandler("onClientPedDamage",root,function(attacker,weapon,bodypart,damage) local skin = getElementModel(source) if skin == 68 and weapon == 37 then cancelEvent() end end) and this: function stopDamage( thePed, attacker, weapon, bodypart) if ( getElementModel ( source ) == 92 = 37 ) cancelEvent() end not works tell me what is wrong please Link to comment
DNL291 Posted April 26, 2012 Share Posted April 26, 2012 addEventHandler("onClientPedDamage", root, cancelEvent) Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 @DNL291: If you cancel ALL the ped's damage, then how are the players going to kill the zombies? addEventHandler ( "onClientPedDamage", root, function ( attacker, weapon, bodypart, damage ) local skin = getElementModel ( source ) if ( skin == 68 and isPedOnFire ( source ) ) then cancelEvent ( ) end end ) Link to comment
freakk Posted April 26, 2012 Author Share Posted April 26, 2012 addEventHandler("onClientPedDamage", root, cancelEvent) didn't works Link to comment
denny199 Posted April 26, 2012 Share Posted April 26, 2012 Cop&Paste the one off solidsnake, btw, the code that DNL291 typed is wrong. this is needed: addEventHandler("onClientPedDamage", root, cancelEvent() ) () was missing. Link to comment
freakk Posted April 26, 2012 Author Share Posted April 26, 2012 addEventHandler ( "onClientPedDamage", root, function ( attacker, weapon, bodypart, damage ) local skin = getElementModel ( source ) if ( skin == 68 and isPedOnFire ( source ) ) then cancelEvent ( ) end end ) this does not work solid Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 Cop&Paste the one off solidsnake, btw, the code that DNL291 typed is wrong. this is needed: addEventHandler("onClientPedDamage", root, cancelEvent() ) () was missing. That's not required, if you add it, then it won't work. @freakk: You've set that script as client side, right? the script should check if the ped is on fire, if so, cancel the event. Link to comment
freakk Posted April 26, 2012 Author Share Posted April 26, 2012 Ok. you're fantastic man. THANK U VERY MUCH! Link to comment
DNL291 Posted April 26, 2012 Share Posted April 26, 2012 addEventHandler("onClientPedDamage", root, cancelEvent) didn't works worked for me. anyway that's not what you want. Cop&Paste the one off solidsnake not copied from anyone. the code that DNL291 typed is wrong. this is needed:[/i] addEventHandler("onClientPedDamage", root, cancelEvent() ) () was missing. That's not required, if you add it, then it won't work. Link to comment
Castillo Posted April 26, 2012 Share Posted April 26, 2012 Ok. you're fantastic man. THANK U VERY MUCH! You're welcome. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now