createTeam | Multi Theft Auto: Wiki Skip to content

createTeam

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is for creating a new team, which can be used to group players. Players will not join the team until they are respawned.

Syntax

createTeam ( )

Code Examples

server

Example 1:This example creates a new team for a player, then adds him to it.

function gimmeATeam(source, commandName, teamName)
local newTeam = createTeam(teamName) -- create a new team with the specified name
if newTeam then -- if it was successfully created
setPlayerTeam(source, newTeam) -- add the player to the new team
end
end
addCommandHandler("giveteam", gimmeATeam)