Black2 Posted May 31, 2015 Share Posted May 31, 2015 Hello,I was wondering how do I not shoot team. I have this teamList = { -- you must add some teams here. ["SWAT"] = true, ["Police"] = true, ["Civil"] = true } function checkPlayerInTeam( ) local team = getPlayerTeam( getLocalPlayer() ) if team then if ( teamList[getTeamName( team )] ) then toggleControl("fire", false); end else toggleControl("fire", true); end end setTimer(checkPlayerInTeam, 5000, 0 ) -- every second it will check if you are in team. When you enter the team he did not shoot but when it comes out still not firing,how do I get out when he comes back to shoot ? Link to comment
Moderators IIYAMA Posted June 1, 2015 Moderators Share Posted June 1, 2015 setControlState Add that function with the same arguments as toggleControl. So one is for toggling and one for change the state. Also put between line 11 and 12 another else, for disabling the control. 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