Jump to content

onClientPedWasted always return weapon = 63


Recommended Posts

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

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