Jump to content

fire


freakk

Recommended Posts

Posted

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) 

Posted

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.

Posted
addEvent("onZombieCreated",true) 
addEventHandler("onZombieCreated",root, 
function () 
   if  (getElementModel (source)  ==  68) then 
       setPedOnFire(source, true) 
       SetTimer(function() 
setPedOnFire(source, false) 
,1000, 0) 
   end 
end) 

Posted (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 by Guest

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

Posted
addEventHandler("onClientPedDamage", root, cancelEvent) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

@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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Cop&Paste the one off solidsnake, btw, the code that DNL291 typed is wrong. this is needed:

addEventHandler("onClientPedDamage", root, cancelEvent() ) 

() was missing.

Sometimes I dream about cheese

Posted
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

Posted
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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
Ok. you're fantastic man. THANK U VERY MUCH!

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...