engine

get_view_angles

Returns current player's client view angles

vec3_t get_view_angles())

Example

print(engine.get_view_angles())

execute_cmd

Executes a provided command

void execute_cmd(<string> command_name)
FieldsDescription

command_name string

console command name

Example

engine.execute_cmd("say hi")

get_choked_commands

Returns the number of choked commands

int get_choked_commands()

Example

print("choked commands", engine.get_choked_commands())

get_last_acknowledged_command

Returns the last acknowledged command

int get_last_acknowledged_command()

Example

print("last ack command", engine.get_last_acknowledged_command())

get_last_outgoing_command

Returns the last outgoing command

int get_last_outgoing_command()

Example

print("last outgoing command", engine.get_last_outgoing_command())

get_latency

Returns latency

int get_latency([optional] <e_latency_flows> latency_type = e_latency_flows.OUTGOING)
FieldsDescription

latency_type e_latency_flows

[optional] latency type (outgoing by default)

Example

print("latency", engine.get_latency(e_latency_flows.INCOMING))

get_level_name

Returns the level name as a string

string get_level_name()

Example

print("level name", engine.get_level_name())

get_level_name_short

Returns a short version of the level name as a string

string get_level_name_short()

Example

print("level name short", engine.get_level_name_short())

is_app_active

Returns if the application is active or not (e.g. whether you're tabbed in or not)

bool is_app_active()

Example

print("is app active", engine.is_app_active())

get_local_player_index

Returns the local player's entity index

int get_local_player_index()

Example

print("local player idx", engine.get_local_player_index())

get_player_index_from_user_id

Returns player entity index from their user id

int get_player_index_from_user_id(<int> user_id)
FieldsDescription

user_id int

player's user id

Example

local function event_callback(event_info)
    local user_id = engine.get_player_index_from_user_id(event_info.userid)
    print(user_id)
end

is_connected

Returns if the user is connected to a server

bool is_connected()

Example

print("is connected", engine.is_connected())

is_in_game

Returns if the user is in game

bool is_in_game()

Example

print("is in game", engine.is_in_game())

play_sound

Plays a sound on the client

void play_sound(<string> name, [optional] <float> volume = 1.0, [optional] <int> pitch = 100)
FieldsDescription

name string

sound name

volume float

[optional] sound's volume

pitch int

[optional] sound's pitch

Example

engine.play_sound("sound.wav", 1.0, 100)

get_view_angles

returns camera angles

angle_t get_view_angles()

set_view_angles

sets camera angles

void set_view_angles(<angle_t> camera_angles)

get_bomb_radius

returns bomb radius dependent on map and game mode

float get_bomb_radius()

get_bsp_entity

returns bsp entity info for the specified classname

string[] get_bsp_entity(<string> classname)

get_bsp_entities

returns all bsp entity infos

string[][] get_bsp_entities()

Last updated