boro Posted July 25, 2013 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) I'll help When I Can.
MIKI785 Posted July 25, 2013 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) Lua Scripter Owner of mshost.cz MTA portal.
TAPL Posted July 25, 2013 Posted July 25, 2013 The event onClientPedDamage is for ped only, use onClientPlayerDamage for player.
boro Posted July 25, 2013 Author 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 ? I'll help When I Can.
Castillo Posted July 25, 2013 Posted July 25, 2013 I don't understand what do you mean, mind explaining yourself? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
boro Posted July 25, 2013 Author Posted July 25, 2013 problem solved i use this if ( getElementType( attacker ) == "vehicle" ) then ty all for help I'll help When I Can.
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