Jump to content

[HELP]How Do for team not shoot ??


Black2

Recommended Posts

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...