[Quest API] Add SendGMCommand() to Perl/Lua. (#2527)

* [Quest API] Add SendGMCommand() to Perl/Lua.

# Perl
- Add `$client->SendGMCommand(message)` to Perl.
- Add `$client->SendGMCommand(message, ignore_status)` to Perl.

# Lua
- Add `client:SendGMCommand(message)` to Lua.
- Add `client:SendGMCommand(message, ignore_status)` to Lua.

# Notes
- `ignore_status` allows you to have players use GM commands that they are not the required status level for through the Quest API.
- `ignore_status` is default false, so if you don't send it, it checks and makes sure the player can use the command you're sending before allowing it.

* Typo.

* Formatting.
This commit is contained in:
Kinglykrab
2022-11-14 16:47:02 -05:00
committed by GitHub
parent 36887203d3
commit f668949c24
7 changed files with 41 additions and 8 deletions
+3 -3
View File
@@ -17,15 +17,15 @@ typedef struct {
CmdFuncPtr function; // null means perl function
} CommandRecord;
extern int (*command_dispatch)(Client *,std::string);
extern int (*command_dispatch)(Client *, std::string, bool);
extern int command_count; // Commands Loaded Count
// Command Utilities
int command_init(void);
void command_deinit(void);
int command_add(std::string command_name, std::string description, uint8 admin, CmdFuncPtr function);
int command_notavail(Client *c, std::string message);
int command_realdispatch(Client *c, std::string message);
int command_notavail(Client *c, std::string message, bool ignore_status);
int command_realdispatch(Client *c, std::string message, bool ignore_status);
void command_logcommand(Client *c, std::string message);
uint8 GetCommandStatus(Client *c, std::string command_name);
void ListModifyNPCStatMap(Client *c);