Jump to content

need help


yesyesok

Recommended Posts

addEventHandler ( "onPlayerDamage", root, 
    function ( attacker ) 
        if ( getElementType ( attacker ) == "vehicle" ) then 
            killPed ( source ) 
        end 
    end 
) 

@EDIT: Damn man! You was faster.

Edited by Guest
Link to comment
addEventHandler("onPlayerDamage", root, function(attacker) 
    if (getElementType(attacker) == "vehicle") then 
        if (getElementModel(attacker) == vehicleID) then -- change it to your vehicle id 
        killPed(source)  
        end 
    end 
end) 

Link to comment
addEventHandler("onPlayerDamage", root, function(attacker) 
    if (isElement(attacker) and getElementType(attacker) == "vehicle") then 
        if (getElementModel(attacker) == vehicleID) then -- change it to your vehicle id 
        killPed(source) 
        end 
    end 
end) 

Link to comment

@unpredictable More like worst way.

Try this client-side:

addEventHandler("onClientPlayerDamage", localPlayer, function(attacker) 
 if (isElement(attacker) and getElementType(attacker) == "vehicle") then 
  setElementHealth(localPlayer, 0) 
 end 
end) 

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