DRW Posted April 22, 2015 Share Posted April 22, 2015 Hello, addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 then killPed(source,attacker,weapon) end end) How can I make this to kill only peds and not players? Link to comment
xXMADEXx Posted April 22, 2015 Share Posted April 22, 2015 Try this: addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 and getElementType ( source ) ~= "ped" then killPed(source,attacker,weapon) end end) Link to comment
DRW Posted April 23, 2015 Author Share Posted April 23, 2015 xXMADEXx said: Try this: addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 and getElementType ( source ) ~= "ped" then killPed(source,attacker,weapon) end end) It works, but zombies don't die with it! Link to comment
WhoAmI Posted April 23, 2015 Share Posted April 23, 2015 Quote This event is triggered when a player is damaged, in any way. Link to comment
Dimos7 Posted April 23, 2015 Share Posted April 23, 2015 addEventHandler("onPlayerDamage", root, function(attacker, weapon) if weapon == 8 and getElementType(source) == "ped" then if (getElementData(source, "zombie") then killPed(source, attacker, weapon) end end end ) Link to comment
Walid Posted April 23, 2015 Share Posted April 23, 2015 i already gave him the same answer here 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