SetPlayerTeam

From GT-MP
Jump to: navigation, search
SetPlayerTeam
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

This function sets the team of the given player.


Syntax

API.setPlayerTeam(Client player, int team);

Required Arguments

  • player: parameter input should be in Client type.
  • team: parameter input should be in int type.

Usage example(s)

/team command which allows you to set your team:

In C#
Server-Side Function

[Command("team")]
public void CMD_SetTeam(Client player, int team)
{
    API.setPlayerTeam(player, team);
    API.sendChatMessageToPlayer(player, "Joined team: " + team);
}

References