RemovePlayerFromTeam

From Multi Theft Auto: Wiki
Revision as of 15:27, 30 June 2006 by MrJax (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function is for removing a player from his current team.

Syntax

bool removePlayerFromTeam ( player thePlayer )

Required Arguments

  • thePlayer: The player you wish to remove from his team.

Returns

Returns 'true' if the player was on a team and was successfully removed it, 'false' otherwise.

Example

This example creates a new team for a player, adds him to it, then removes him.

addCommandHandler ( "gimmeATeam", "gimmeATeam" )
function gimmeATeam ( source, key, teamName )
  team = createTeam ( teamName ) -- create a new team with the specified name
  if ( team ) then -- if it was successfully created
    addPlayerToTeam ( source, team ) -- add the player to the new team
    removePlayerFromTeam ( source ) -- remove him from the team
  end
end

See Also