Player/SetTeam

From Garry's Mod
Jump to: navigation, search
 Player:SetTeam( )

Contents

Description

Sets the player to the chosen team.

Arguments

number Team

The team that the player is being set to.

Examples

Example

Sets the players team to the first argument when writing "set_team" into the console and respawns the player afterwards, ex. "set_team 1".

function ChangeMyTeam( ply, cmd, args )
    ply:SetTeam( args[1] )
    ply:Spawn()
end
concommand.Add( "set_team", ChangeMyTeam )

Output:

Sets the player to team 1 and respawns him/her.
Personal tools
Navigation