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.version() | string or nil | Engine build number, for example "14123"; nil only before the engine client interface is available. |
engine.get_net_channel(slot?) | userdata or nil | Opaque handle with no methods; slot defaults to 0. |
engine.chat_print
engine.chat_print(...)Joins arguments with spaces, each converted as tostring converts it, and prints them to the local player's HUD chat. Other players do not receive the message. Does nothing while the HUD chat does not exist.
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 clamped to 0..1 and scaled by the game's volume setting. An unknown sound does nothing.
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 in module's type scope (for example 'client.dll'). Base classes are not searched. A module, class or field that is neither a string nor a number raises.
Returns: integer offset, or 0 if not found.
