engine¶
execute_client_cmd¶
engine.execute_client_cmd(command: string)
| Name | Type | Description |
|---|---|---|
| command | string |
Command to execute |
Example
play_sound¶
engine.play_sound(sound_name: string, volume: number)
| Name | Type | Description |
|---|---|---|
| sound_name | string |
Sound name |
| volume | number |
Volume in the range [0.0, 1.0] |
chat_print¶
engine.chat_print(text: string)
| Name | Type | Description |
|---|---|---|
| text | string |
Text to print |
camera_in_thirdperson¶
engine.camera_in_thirdperson(): boolean
get_level_name¶
engine.get_level_name(): string
get_product_version_string¶
engine.get_product_version_string(): string
get_net_channel¶
engine.get_net_channel(): net_channel_t
get_hitbox¶
engine.get_hitbox(pawn: base_entity_t, hitbox_index: number): hitbox_t
| Name | Type | Description |
|---|---|---|
| pawn | base_entity_t |
Player pawn |
| hitbox_index | number |
Hitbox index |
get_hitbox_pos¶
engine.get_hitbox_pos(pawn: base_entity_t, hitbox_index: number): vec3_t
| Name | Type | Description |
|---|---|---|
| pawn | base_entity_t |
Player pawn |
| hitbox_index | number |
Hitbox index |
Info
Returns nil if unsuccessful
Example
get_netvar_offset¶
engine.get_netvar_offset(module_name: string, table_name: string, prop_name: string): number
| Name | Type | Description |
|---|---|---|
| module_name | string |
Module name |
| table_name | string |
Name of the table |
| prop_name | string |
Name of the property |
trace_shape¶
engine.trace_shape(ray: ray_t, start: vec3_t, end: vec3_t, filter: trace_filter_t): trace_t
| Name | Type | |
|---|---|---|
| ray | ray_t |
|
| start | vec3_t |
|
| end | vec3_t |
|
| filter | trace_filter_t |
Example
trace_bullet¶
engine.trace_bullet(from_pawn: base_entity_t, from: vec3_t, to: vec3_t): number
| Name | Type | Description |
|---|---|---|
| from_pawn | base_entity_t |
Player whose weapon will be used for this trace |
| from | vec3_t |
Position to start tracing from |
| to | vec3_t |
Position where the trace ends |
Info
Returns nil if bullet can't hit