DarkRP.Player.ChangeTeam

From GMod Wiki

Jump to: navigation, search
Deletion.pngThis page has been nominated for deletion. Deletion is due within approximately 30 days from nomination, unless the deletion has been disputed on the talk page. See more pages nominated for deletion here.
Reason for deletion: Not what Garry wants the wiki to be used for
Last Edit was made on 11/16/2011
Gamemode Function: DarkRP.Player.ChangeTeam
DarkRP.Player.ChangeTeam is a function that is defined in the DarkRP Gamemode and its derivatives.
Function
Syntax Player:ChangeTeam( String team, Boolean force )
Where is this used?
Description:
Changes the players team
Returns: nil
Part of Library: Player
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DarkRP.Player.ChangeTeam]DarkRP.Player.ChangeTeam [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionChange a player's team by saying: /IDon'tBelieve
Used onNewerServer.png
Code
 
local function LastSaid( ply, text, team, death )
    if (string.sub(text, 1, 14) == "/IDon'tBelieve") then
	ply:ChangeTeam( "TEAM_HOBO", true )
    end
end
hook.Add( "PlayerSay", "LastSaid", LastSaid );
OutputThe player turns into a hobo.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox