engine
Game state and level queries, local HUD chat output, sound playback and netvar offsets.
State and level information
| Function | Returns | Description |
|---|---|---|
engine.is_in_game() | boolean | Whether the client is in game. |
engine.level_name_short() | string | Map name, for example "de_mirage"; "" without a map. |
engine.level_name() | string | Full level path; "" before connecting. |
engine.get_product_version_string() | string | Engine build number. |
engine.camera_in_thirdperson() | boolean | Whether the camera is in third person. |
engine.get_net_channel(slot?) | userdata or nil | Opaque 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.
