2021-05-02: Command Prefix
Commands are normally /command; however, with y_commands you can change this symbol to anything you want per-command:
There?s also Command_GetPrefix, Command_GetPrefixNamed, Command_IsPrefixUsed, and Command_IsValidPrefix to get meta-data on prefixes.
There is no global prefix, but if you want to change it for every command you can use a simple loop:
Commands are normally /command; however, with y_commands you can change this symbol to anything you want per-command:
Quote:
YCMD:ban(playerid, params[], help)
{
____// Admin "!ban" command.
}
YCMD:kick(playerid, params[], help)
{
____// Admin "!kick" command.
}
YCMD:me(playerid, params[], help)
{
____// Player "#me" command.
}
YCMD:help(playerid, params[], help)
{
____// Player "/help" command.
}
public OnScriptInit()
{
____Command_SetPrefix(YCMD:ban, '!');? ? // /ban? -> !ban
____Command_SetPrefixNamed("kick", '!'); // /kick -> !kick
____Command_SetPrefix(YCMD:me, '#');? ?? // /me? -> #me
____// "/help" doesn't need setting.
}
There?s also Command_GetPrefix, Command_GetPrefixNamed, Command_IsPrefixUsed, and Command_IsValidPrefix to get meta-data on prefixes.
There is no global prefix, but if you want to change it for every command you can use a simple loop:
Quote:
foreach (new c : Command)
{
____Command_SetPrefix(c, '!');
}