Jump to content

[HELP]Dont get damage if you are in LS


Recommended Posts

Well im making this, if somebody damage you and you are in los santos, you dont get damaged but doesnt work

--Server Side

function cancelDamage( attacker, weapon, bodypart, loss )  
    local location = getElementZoneName ( attacker, true )  
    if ( location == "Los Santos" ) then 
    cancelEvent() 
    end 
end 
addEventHandler ( "onPlayerDamage", root, cancelDamage )) 

Link to comment

"onPlayerDamage" can not be cancelled

function cancelDamage( attacker ) 
    local x,y,z = getElementPosition(attacker) 
    local location = getZoneName ( x, y, z, true ) 
    if ( location == "Los Santos" ) then 
        cancelEvent() 
    end 
end 
addEventHandler ( "onClientPlayerDamage", root, cancelDamage ) 

Edited by Guest
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...