🎉Event

Table to work with game events.

When you install events, you send the subscribe message to the server, which is potentially unsafe. Therefore, you won't be able to install new listeners when you have unsafe features disabled in the Settings -> Security tab.

The list of events can be found in the "pak01_dir.vpk" under "resource/game.gameevents."

AddListener(name: string): nil

Name
Type
Description

name

string

Event name

Installs an event listener for the desired event.


IsReliable(event: CEvent): boolean

Name
Type
Description

event

Checks if the event is reliable.


IsLocal(event: CEvent): boolean

Name
Type
Description

event

Checks if the event is local or networked.


IsEmpty(event: CEvent): boolean

Name
Type
Description

event

Checks if the event is empty.


GetBool(event: CEvent, field: string): boolean

Name
Type
Description

event

field

string

Field name

Returns the boolean value of the specified event field.


GetInt(event: CEvent, field: string): integer

Name
Type
Description

event

field

string

Field name

Returns the integer value of the specified event field.


GetUint64(event: CEvent, field: string): integer

Name
Type
Description

event

field

string

Field name

Returns the uint64 value of the specified event field.


GetFloat(event: CEvent, field: string): number

Name
Type
Description

event

field

string

Field name

Returns the floating value of the specified event field.


GetString(event: CEvent, field: string): string

Name
Type
Description

event

field

string

Field name

Returns the string value of the specified event field.

Last updated