Twisted Posted July 1, 2011 Posted July 1, 2011 this may be a nooby question but me and my friend (good scripter) cant seem to cancel the event when some one is injured by a vehicle maybe some of u could help function nodamage(attacker, bodypart) vehicle = getPedOccupiedVehicle(source) if (vehicle) then cancelEvent() end end addEventHandler("onClientPlayerDamage", getRootElement(),nodamage)
Castillo Posted July 1, 2011 Posted July 1, 2011 gokal, that's the same but without the "()"...... He's trying to do when someone get's injured by a vehicle it will not take health from him. function nodamage(attacker, bodypart) local vehicle = getPedOccupiedVehicle(attacker) if (vehicle) then cancelEvent() end end addEventHandler("onClientPlayerDamage", getLocalPlayer(),nodamage) Try with that. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
JR10 Posted July 1, 2011 Posted July 1, 2011 attacker: A player element representing the attacker or vehicle element (when being run over or falling off a bike). That's from the onClientPlayerDamage page so can't it just be: function nodamage(attacker, bodypart) if getElementType(attacker) == 'vehicle' then cancelEvent() end addEventHandler("onClientPlayerDamage", getLocalPlayer(),nodamage) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Castillo Posted July 1, 2011 Posted July 1, 2011 Yeah, I forgot about that . San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Twisted Posted July 1, 2011 Author Posted July 1, 2011 thank you castillo and JR10 for helping me i am a noob at canceling events
Castillo Posted July 1, 2011 Posted July 1, 2011 No problem. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
JR10 Posted July 1, 2011 Posted July 1, 2011 No problem. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
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