DarkRP.Player.ChangeTeam
Jump to navigation
Jump to search
This page refers to DarkRP 2.4.3. This information may be incorrect as of later versions. Check here for a up-to-date list of functions. |
---|
Function | |
Function name | Player:ChangeTeam(table team, boolean force) |
Description: | |
Changes the players team | |
Returns: | boolean |
Part of Library: | Player |
Realm: |
![]() |
BBCode Link: | [b][url=http://wiki.darkrp.com/index.php?title=DarkRP.Player.ChangeTeam]Player:ChangeTeam[/url][/b] |
Examples[edit]
Description | Change a player's team by saying: /IDon'tBelieve |
---|---|
Used on | ![]() |
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 );
|
Output | The player turns into a hobo. |
Additional Notes[edit]
- Returns false if the job could not be changed (eg. team ban, arrested, escaping demotion), true if the player's job changed successfully.