Jump to content

[HELP] No Work Rammed Vehicle


Seba500PLK

Recommended Posts

When a player try to rammed it nothing happens.

  
  
--Client 
function DamageToPed(attacker, weapon, bodypart, loss) 
    cancelEvent() 
  
    if weapon and attacker then 
        if weapon == 49 then --Rammed 
            outputChatBox("Rammed") 
        end 
        if bodypart == 9 then --HeadShot 
            setElementHealth(source, 0) 
        end 
    end 
end 
addEventHandler("onClientPedDamage", getRootElement(), DamageToPed) 
  
  

Link to comment

source is not defined in client side

function DamageToPed(attacker, weapon, bodypart, loss) 
    if weapon and attacker and attacker ~= getLocalPlayer() then 
        if weapon == 49 then --Rammed 
            outputChatBox("Rammed") 
        end 
        if bodypart == 9 then --HeadShot 
            setElementHealth(getLocalPlayer(), 0) 
        end 
     cancelEvent() 
    end 
end 
addEventHandler("onClientPedDamage", getRootElement(), DamageToPed) 

Link to comment
source is not defined in client side
function DamageToPed(attacker, weapon, bodypart, loss) 
    if weapon and attacker and attacker ~= getLocalPlayer() then 
        if weapon == 49 then --Rammed 
            outputChatBox("Rammed") 
        end 
        if bodypart == 9 then --HeadShot 
            setElementHealth(getLocalPlayer(), 0) 
        end 
     cancelEvent() 
    end 
end 
addEventHandler("onClientPedDamage", getRootElement(), DamageToPed) 

... source is victim

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