Store indexes by ref

This commit is contained in:
OciXCrom 2018-08-30 15:40:44 +02:00
parent aea2996456
commit 41f2dbed96

View File

@ -888,14 +888,15 @@ stock get_players_ex(players[MAX_PLAYERS], &num, GetPlayersFlags:flags = GetPlay
* @param FlagManager 0 opts out of flag manager, 1 opts in, -1 selects * @param FlagManager 0 opts out of flag manager, 1 opts in, -1 selects
* automatically * automatically
* @param info_ml If true, the parameter "info" will be looked up as multilingual key * @param info_ml If true, the parameter "info" will be looked up as multilingual key
* @param sayid Variable to store the "say" command index
* @param sayteamid Variable to store the "say_team" command index
* *
* @return Id of the "say_team" command or 0 on failure. The index of the "say" * @noreturn
* command is equal to the returned index + 1.
* @error If an invalid callback function is specified, an error * @error If an invalid callback function is specified, an error
* will be thrown. * will be thrown.
*/ */
stock register_chatcmd(const client_cmd[], const function[], flags = -1, const info[] = "", FlagManager = -1, bool:info_ml = false) stock register_chatcmd(const client_cmd[], const function[], flags = -1, const info[] = "", FlagManager = -1, bool:info_ml = false, &sayid = 0, &sayteamid = 0)
{ {
register_clcmd(fmt("say %s", client_cmd), function, flags, info, FlagManager, info_ml); sayid = register_clcmd(fmt("say %s", client_cmd), function, flags, info, FlagManager, info_ml);
return register_clcmd(fmt("say_team %s", client_cmd), function, flags, info, FlagManager, info_ml); sayteamid = register_clcmd(fmt("say_team %s", client_cmd), function, flags, info, FlagManager, info_ml);
} }