CEngineClient

Usage: game.engine:{method}

An instance of this type provides a way to interface with Source 2's Engine-to-Client service.

GetLastTimestamp

Method

Returns last timestamp, in seconds.

Arguments

None.

Returns

Type
Description

float

Timestamp, in seconds.

Example

local last_time = game.engine:GetLastTimestamp();

GetLastServerTick

Method

Returns last server tick number.

Arguments

None.

Returns

Type
Description

int

Server tick number.

Example


InGame

Method

Returns whether the client is currently in game.

Arguments

None.

Returns

Type
Description

bool

In-game status.

Example


IsConnected

Method

Returns whether the client is currently connected to a game server.

Arguments

None.

Returns

Type
Description

bool

true if connected.

Example


GetNetChan

Method

Returns the Network Channel used for network communication.

Arguments

None.

Returns

Type
Description

Network channel, or nil if does not exist.

Example


ClientCmd

Method

Executes a client-sided console command.

Arguments

Name
Type
Description

cmd

string

Command to execute.

bool

unrestricted

Whether should the execution preserve any restrictions. Defaults to false.

Returns

Nothing.

Example


GetScreenSize

Method

Returns client window screen size.

Arguments

None.

Returns

Type
Description

int

Width.

int

Height.

Example

Last updated