Jump to content

[HELP]Stat part 2


ali

Recommended Posts

Posted
client:
function firing( _, _, _, _, _, _, hitElement) 
    if hitElement and getElementType( hitElement ) == "vehicle" and getElementHealth(hitElement) <= 300 and not getElementData(hitElement,"lastDamageFrom") then 
        setElementData(hitElement,"lastDamageFrom",getLocalPlayer()) 
    end 
end 
addEventHandler("onClientPlayerWeaponFire", getRootElement(), firing ) 

server:

function add() 
    local player = getElementData(source,"lastDamageFrom") 
    if player then 
    if (getVehicleType ( source ) == "Automobile")then 
         iii(player) 
    elseif (getVehicleType ( source ) == "Helicopter")then 
         ooo(player) 
    elseif (getVehicleType ( source ) == "Boat")then 
         lll(player) 
    end 
end 
end 
  
 addEventHandler("onVehicleExplode", getRootElement(), add ) 

This is maybe not the most efficient solution, but should work.

You should check if isElment(player) or not

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