Black2 Posted June 5, 2015 Share Posted June 5, 2015 Hello,I got this script it will not let the team shoot but when it leaves the team still not shooting anyone could fix? Thx. teamList = { -- you must add some teams here. ["SWAT"] = true, ["Police"] = true, ["Civil"] = false } function checkPlayerInTeam( ) local team = getPlayerTeam( getLocalPlayer() ) if team then if ( teamList[getTeamName( team )] ) then toggleControl ("fire", false) toggleControl ("aim_weapon", false) toggleControl ("vehicle_fire", false) end else toggleControl ("fire", true) toggleControl ("aim_weapon", true) toggleControl ("vehicle_fire", true) end end setTimer(checkPlayerInTeam, 1000, 0 ) -- every second it will check if you are in team. Link to comment
Estevam2d Posted June 5, 2015 Share Posted June 5, 2015 I'm not sure! teamList = { -- you must add some teams here. ["SWAT"] = true, ["Police"] = true, ["Civil"] = false } function checkPlayerInTeam( ) local team = getPlayerTeam( getLocalPlayer() ) if team then if ( teamList[getTeamName( team )] ) then toggleControl ("fire", false) toggleControl ("aim_weapon", false) toggleControl ("vehicle_fire", false) else toggleControl ("fire", true) toggleControl ("aim_weapon", true) toggleControl ("vehicle_fire", true) end end end setTimer(checkPlayerInTeam, 1000, 0 ) Link to comment
Enargy, Posted June 5, 2015 Share Posted June 5, 2015 teamList = { ["SWAT"] = true, ["Police"] = true } Link to comment
jingzhi Posted June 9, 2015 Share Posted June 9, 2015 Hello,I got this script it will not let the team shoot but when it leaves the team still not shooting anyone could fix?Thx. teamList = { -- you must add some teams here. ["SWAT"] = true, ["Police"] = true, ["Civil"] = false } function checkPlayerInTeam( ) local team = getPlayerTeam( getLocalPlayer() ) if team then if ( teamList[getTeamName( team )] ) then toggleControl ("fire", false) toggleControl ("aim_weapon", false) toggleControl ("vehicle_fire", false) end else toggleControl ("fire", true) toggleControl ("aim_weapon", true) toggleControl ("vehicle_fire", true) end end setTimer(checkPlayerInTeam, 1000, 0 ) -- every second it will check if you are in team. I dont think this way of doing it is very good, because you are toggling the control every second using a timer. You should use this function only when the player's team changes 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