PlayerManager

Summary

Methods

Method Returns
GetPlayers() Player[]
GetPlayerById(id: int) Player | nil
GetPlayerByOnlineId(onlineId: int) Player | nil
GetPlayerByGuid(guid: Guid) Player | nil
GetPlayerByName(name: string) Player | nil
GetPlayersByName(name: string) Player[]
GetPlayerCount() int
GetPlayersByTeam(team: TeamId) Player[]
GetPlayersBySquad(team: TeamId, squad: SquadId) Player[]
GetSquadLeader(team: TeamId, squad: SquadId) Player | nil
CreatePlayer(name: string, team: TeamId, squad: SquadId) Player | nil
DeletePlayer(player: Player) void
SetSpectatorEnabled(enabled: bool) void
IsSpectatorEnabled() bool
FadeInAll(fadeTime: float) void
FadeOutAll(fadeTime: float) void
GetSpectatorCount() int

Methods

GetPlayers

GetPlayers(): Player[]

Returns

Type Description
Player[]

GetPlayerById

GetPlayerById(id: int): Player | nil

Parameters

Name Type Description
id int

Returns

Type Description
Player | nil

GetPlayerByOnlineId

GetPlayerByOnlineId(onlineId: int): Player | nil

Parameters

Name Type Description
onlineId int

Returns

Type Description
Player | nil

GetPlayerByGuid

GetPlayerByGuid(guid: Guid): Player | nil

Parameters

Name Type Description
guid Guid

Returns

Type Description
Player | nil

GetPlayerByName

GetPlayerByName(name: string): Player | nil

Parameters

Name Type Description
name string

Returns

Type Description
Player | nil

GetPlayersByName

GetPlayersByName(name: string): Player[]

Parameters

Name Type Description
name string

Returns

Type Description
Player[]

GetPlayerCount

GetPlayerCount(): int

Returns

Type Description
int

GetPlayersByTeam

GetPlayersByTeam(team: TeamId): Player[]

Parameters

Name Type Description
team TeamId

Returns

Type Description
Player[]

GetPlayersBySquad

GetPlayersBySquad(team: TeamId, squad: SquadId): Player[]

Parameters

Name Type Description
team TeamId
squad SquadId

Returns

Type Description
Player[]

GetSquadLeader

GetSquadLeader(team: TeamId, squad: SquadId): Player | nil

Parameters

Name Type Description
team TeamId
squad SquadId

Returns

Type Description
Player | nil

CreatePlayer

CreatePlayer(name: string, team: TeamId, squad: SquadId): Player | nil

Parameters

Name Type Description
name string
team TeamId
squad SquadId

Returns

Type Description
Player | nil

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

Type Description
bool

FadeInAll

FadeInAll(fadeTime: float)

Parameters

Name Type Description
fadeTime float

FadeOutAll

FadeOutAll(fadeTime: float)

Parameters

Name Type Description
fadeTime float

GetSpectatorCount

GetSpectatorCount(): int

Returns

Type Description
int
Last modified December 11, 2020: Update VeniceEXT to 1.0.4 (dc9afaf6)