fix(lua): better error reporting when calling player commands (#2932)

This commit is contained in:
Quentin
2024-04-10 11:43:55 +02:00
committed by GitHub
parent c0214aeb85
commit 6f8490f450
5 changed files with 62 additions and 8 deletions

View File

@ -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()
```

View File

@ -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)
```