19.06.2016, 23:25
Quote:
But this cannot be changed as a custom input during runtime. I know that you can call a command as such, but we used to call any with a custom input. For example: http://pastebin.com/raw/K7huGFvb
Where everything passed is handled the same as a typed command... |
Code:
CMD:callcommand(playerid, params[]) { new public[32], pid, cmd[32], parameters[128]; if(sscanf(params, "us[32]s[128]", pid, cmd, parameters)) return SendClientMessage(playerid, -1, "* /callcommand [playerid] [command name] [parameters]"); format(public, sizeof(public), "cmd_%s", cmd); CallLocalFunction(public, "is", pid, parameters); return 1; }
Note that I didn't put a slash in front of command name (ban instead of /ban)