HUNGRY:3 Posted June 24, 2015 Share Posted June 24, 2015 hello i made a script but it's not working the problem is when the attacker has data of "bandit" can't shoot the other who has data of Bandit code : function noshootteam(attacker, target ) if getElementData( attacker,"bandit") == true then if getElementData( target,"bandit") == true then outputChatBox ( "Don't kill your teammates!!!",attacker, 255, 0, 0 ) cancelEvent() end end end addEventHandler ( "onClientPlayerWeaponFire", root, noshootteam ) Link to comment
Moderators IIYAMA Posted June 24, 2015 Moderators Share Posted June 24, 2015 A easier solution would be cancelling: Cancel: "onClientPlayerDamage" Cancelling firing when your teammate jumps in front of you, is pretty complex stuff for a beginner scripter. If you want that, you will have to work with: "onClientPreRender", getPedTargetStart, processLineOfSight, setControlState, etc. 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