Halfmillz Posted May 28, 2013 Share Posted May 28, 2013 when i kill zombie ped with any weapon (not headshot) it alway return weapon value to 63 on event onClientPedWasted, how to slove it? Link to comment
Callum Posted May 28, 2013 Share Posted May 28, 2013 63 is a death reason, rather than a killer weapon. ID 63 means that the ped has died from an explosion. Link to comment
Halfmillz Posted May 28, 2013 Author Share Posted May 28, 2013 63 is a death reason, rather than a killer weapon. ID 63 means that the ped has died from an explosion. but i kill ped with M4 MP5 or any weapons its alway return 63 Link to comment
Halfmillz Posted May 28, 2013 Author Share Posted May 28, 2013 post your code function zombiedamaged ( attacker, weapon, bodypart ) if getElementType ( source ) == "ped" then if (getElementData (source, "zombie") == true) then local zhealth = getElementHealth ( source ) local x, y, z = getElementPosition( source ) local gz = getGroundPosition ( x, y, z ) if ( gz > 1 ) or ( isElementInWater( source ) == false ) then if ( zhealth <=0 ) then setPedAnimation ( source, "ped", "KO_shot_front", 2000, false, true, true) -- make zombie die on ground when killed in the air setElementPosition ( source, x, y, gz+1 ) end end if ( bodypart == 9 ) then helmeted = "no" local zskin = getElementModel ( source ) for k, skin in pairs( helmetzombies ) do if skin == zskin then helmeted = "yes" end end if helmeted == "no" then triggerServerEvent ("headboom", source, source, attacker, weapon, bodypart ) end else triggerServerEvent ("killZomb", source, source, attacker, weapon, bodypart ) end end end end addEventHandler ( "onClientPedDamage", getRootElement(), zombiedamaged ) function zombiedkilled(killer, weapon, bodypart) local x, y, z = getElementPosition( source ) if getElementType ( source ) == "ped" then if (getElementData (source, "zombie") == true) then outputChatBox("weapon = "..weapon) setElementCollisionsEnabled(source, false) if (getElementModel ( source ) == 162) and ( weapon ~= 42 )then createExplosion(x,y,z ,12,true,-1.0,true) end end end end addEventHandler ( "onClientPedWasted", getRootElement(), zombiedkilled ) 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