PlayerManager
Summary
Methods
Methods
GetPlayers
GetPlayers(): Player[]
Returns
GetPlayerById
GetPlayerById(id: int): Player | nil
Parameters
Name |
Type |
Description |
id |
int |
|
Returns
GetPlayerByOnlineId
GetPlayerByOnlineId(onlineId: int): Player | nil
Parameters
Name |
Type |
Description |
onlineId |
int |
|
Returns
GetPlayerByGuid
GetPlayerByGuid(guid: Guid): Player | nil
Parameters
Name |
Type |
Description |
guid |
Guid |
|
Returns
GetPlayerByName
GetPlayerByName(name: string): Player | nil
Parameters
Name |
Type |
Description |
name |
string |
|
Returns
GetPlayersByName
GetPlayersByName(name: string): Player[]
Parameters
Name |
Type |
Description |
name |
string |
|
Returns
GetPlayerCount
GetPlayerCount(): int
Returns
GetPlayersByTeam
GetPlayersByTeam(team: TeamId): Player[]
Parameters
Name |
Type |
Description |
team |
TeamId |
|
Returns
GetPlayersBySquad
GetPlayersBySquad(team: TeamId, squad: SquadId): Player[]
Parameters
Returns
GetSquadLeader
GetSquadLeader(team: TeamId, squad: SquadId): Player | nil
Parameters
Returns
CreatePlayer
CreatePlayer(name: string, team: TeamId, squad: SquadId): Player | nil
Parameters
Returns
DeletePlayer
DeletePlayer(player: Player)
Parameters
Name |
Type |
Description |
player |
Player |
|
SetSpectatorEnabled
SetSpectatorEnabled(enabled: bool)
Spectator mode is disabled by default. A mod can choose to enable it by using this function.
Parameters
Name |
Type |
Description |
enabled |
bool |
|
Example
Events:Subscribe('Extension:Loaded', function()
PlayerManager:SetSpectatorEnabled(true)
end)
IsSpectatorEnabled
IsSpectatorEnabled(): bool
Returns
FadeInAll
FadeInAll(fadeTime: float)
Parameters
Name |
Type |
Description |
fadeTime |
float |
|
FadeOutAll
FadeOutAll(fadeTime: float)
Parameters
Name |
Type |
Description |
fadeTime |
float |
|
GetSpectatorCount
GetSpectatorCount(): int
Returns