mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 01:02:23 +08:00
fix(lua): better error reporting when calling player commands (#2932)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
Table for calling menu commands.
|
||||
|
||||
## Functions (2)
|
||||
## Functions (3)
|
||||
|
||||
### `call(command_name, _args)`
|
||||
|
||||
@ -31,4 +31,14 @@ Call a menu command on a given player.
|
||||
command.call_player(player_idx, command_name, _args)
|
||||
```
|
||||
|
||||
### `get_all_player_command_names()`
|
||||
|
||||
- **Returns:**
|
||||
- `table<integer, string>`: Table that contains the names of all the player commands.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
table<integer, string> = command.get_all_player_command_names()
|
||||
```
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Table containing helper functions for network related features.
|
||||
|
||||
## Functions (12)
|
||||
## Functions (13)
|
||||
|
||||
### `trigger_script_event(bitset, _args)`
|
||||
|
||||
@ -157,4 +157,17 @@ Sends a message to the in game chat.
|
||||
network.send_chat_message(msg, team_only)
|
||||
```
|
||||
|
||||
### `send_chat_message_to_player(player_idx, msg)`
|
||||
|
||||
Sends a chat message to the specified player. Other players would not be able to see the message
|
||||
|
||||
- **Parameters:**
|
||||
- `player_idx` (integer): Index of the player.
|
||||
- `msg` (string): Message to be sent.
|
||||
|
||||
**Example Usage:**
|
||||
```lua
|
||||
network.send_chat_message_to_player(player_idx, msg)
|
||||
```
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user