-
Notifications
You must be signed in to change notification settings - Fork 13
/
commands.inc
46 lines (34 loc) · 1013 Bytes
/
commands.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*!
* PBP/Commands/commands.inc
*
> Priority: 0
*/
CommandDescription<commands> = @"See a list of available commands.";
YCMD:commands(playerid, params[], help) {
if (help) {
SendClientMessage(playerid, COLOR_COMMAND_HELP, "* %s", @"See a list of available commands.");
} else {
this.ShowCommandsDialog(playerid);
}
return 1;
}
CommandDescription<help> = @"View information about a certain command.";
YCMD:help(playerid, params[], help) {
if (help) {
SendClientMessage(playerid, COLOR_COMMAND_HELP, @"* View information about a certain command.");
usage:
SendClientMessage(playerid, COLOR_COMMAND_USAGE, @"* Usage: /help [command]");
} else {
if (isnull(params))
goto usage;
new cmd, idx = 0;
if (params[0] == '/')
idx = 1;
cmd = Command_GetID(params[idx]);
if (cmd == COMMAND_NOT_FOUND || !Command_ReProcess(playerid, params[idx], true)) {
SendClientMessage(playerid, COLOR_COMMAND_ERROR, @"* Invalid command.");
return 1;
}
}
return 1;
}