08.11.2016, 15:00
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext)) { return 1; } new pos, funcname[MAX_FUNC_NAME]; while (cmdtext[++pos] > ' ') { funcname[pos-1] = tolower(cmdtext[pos]); } format(funcname, sizeof(funcname), "cmd_%s", funcname); while (cmdtext[pos] == ' ') pos++; if (!cmdtext[pos]) { cmdtext[--pos] = '\1'; } if (zcmd_g_HasOPCE) { return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos])); } return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]); }