Jump to content

[HELP] No Work Rammed Vehicle


Seba500PLK

Recommended Posts

Posted

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) 
  
  

Posted

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) 

Posted
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

Posted

I know it, it mean the player that got damaged by the attacker, if you're in server side simply you will put source but in client side , there's localPlayer

BTW, explain exactly what do you want to make and maybe i can help you

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