boro Posted July 25, 2013 Share Posted July 25, 2013 Hi all i have godmode script, this script work fine but how make godmode only for player vs player ? because when zombie attack me soo i have still 100% and this is bad i try this but it dont work function god ( attacker ) if ( getElementType ( attacker ) == "player" ) then if attacker == player then cancelEvent() end end end addEventHandler("onPlayerDamage", getRootElement(), god) Link to comment
MIKI785 Posted July 25, 2013 Share Posted July 25, 2013 You can't cancel this event. Use this client sided instead: addEventHandler("onClientPedDamage", root, function (attacker) if getElementType(attacker) == "player" then cancelEvent() end end) Link to comment
TAPL Posted July 25, 2013 Share Posted July 25, 2013 The event onClientPedDamage is for ped only, use onClientPlayerDamage for player. Link to comment
boro Posted July 25, 2013 Author Share Posted July 25, 2013 Yes with onClientPlayerDamage it work nice ty tapl and please how to make godmode for source when is attacker in vehicle ? Link to comment
Castillo Posted July 25, 2013 Share Posted July 25, 2013 I don't understand what do you mean, mind explaining yourself? Link to comment
boro Posted July 25, 2013 Author Share Posted July 25, 2013 problem solved i use this if ( getElementType( attacker ) == "vehicle" ) then ty all for help Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now