HUNGRY:3 Posted June 24, 2015 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 )
Moderators IIYAMA Posted June 24, 2015 Moderators 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. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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