Apo Posted November 27, 2016 Posted November 27, 2016 hi guys my code az not work please help me function PlayerHeadShot ( ammo, attacker, weapon, bodypart ) if ( attacker ) then if ( getElementType ( attacker ) == "player" ) then if ( bodypart == 9 ) then outputChatBox("test wasted",attacker,155,100,100) end end end end addEventHandler ( "onPlayerWasted", getRootElement (), PlayerHeadShot) only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
Apo Posted November 27, 2016 Author Posted November 27, 2016 attacker can not see outputChatBox("test wasted",attacker,155,100,100) only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
keymetaphore Posted November 27, 2016 Posted November 27, 2016 Is your code clientside or serverside? Also - /debugscript 3? AKA Syncer
Apo Posted November 27, 2016 Author Posted November 27, 2016 serverside only god (الله) اشهد ان لا اله الا الله واشهد ان محمد رسول الله
LoPollo Posted November 27, 2016 Posted November 27, 2016 (edited) as @Gourmet. said, are there errors? I can't test since i'm alone now but the code seems correct... when a player dies due headshot the attacker will see in the chat "test wasted" PS not sure about this: getElementType returns false if the given value is false, so lines 3 and 9 can be omitted. That's not true if passing false generate a warning, in which case your code is ok Edited November 27, 2016 by LoPollo
keymetaphore Posted November 28, 2016 Posted November 28, 2016 19 hours ago, LoPollo said: as @Gourmet. said, are there errors? I can't test since i'm alone now but the code seems correct... when a player dies due headshot the attacker will see in the chat "test wasted" PS not sure about this: getElementType returns false if the given value is false, so lines 3 and 9 can be omitted. That's not true if passing false generate a warning, in which case your code is ok Why are you actually using getElementType()? Usually there are no other elements that call "onPlayerWasted". AKA Syncer
ViRuZGamiing Posted November 28, 2016 Posted November 28, 2016 34 minutes ago, Gourmet. said: Why are you actually using getElementType()? Usually there are no other elements that call "onPlayerWasted". killer: Quote an element representing the player or vehicle who was the killer. If there was no killer this is false. "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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