Skip to Content

engine

Game state and level queries, local HUD chat output, sound playback and netvar offsets.


State and level information

FunctionReturnsDescription
engine.is_in_game()booleanWhether the client is in game.
engine.level_name_short()stringMap name, for example "de_mirage"; "" without a map.
engine.level_name()stringFull level path; "" before connecting.
engine.get_product_version_string()stringEngine build number.
engine.camera_in_thirdperson()booleanWhether the camera is in third person.
engine.get_net_channel(slot?)userdata or nilOpaque handle with no methods.

engine.chat_print

engine.chat_print(...)

Joins arguments with spaces and prints them to the local player's HUD chat. Other players do not receive the message.

Returns: no values.

engine.play_sound

engine.play_sound(name, volume?)

Plays a game sound event. Volume defaults to 100. Values at or below 1 are fractions; values above 1 are percentages. The result is scaled by the game's volume setting.

Returns: no values.

engine.get_netvar_offset

engine.get_netvar_offset(module, class, field)

Looks up the byte offset of a schema field declared directly on class. Base classes are not searched.

Returns: integer offset, or 0 if not found.

On this page