27.04.2018, 12:49
I will recommend you to rewrite the command not using switch because it don't need to.
Код:
YCMD:set(playerid, params[], help) { if(playerVariables[playerid][pAdmin] <= 4) return AdminOnly(playerid, 5); new option[32], id, value; if(sscanf(params, "sud", option, id, value)) { Syntax(playerid, "/set <option> <playerid> <value>"); SCM(playerid, COLOR_SERVER, "Options: {FFFFFF}money, level"); return 1; } new bool:foundOption = false; if(!strcmp(option, "money", true, 5)) { if(id == INVALID_PLAYER_ID) return Syntax(playerid, "/set money <playerid> <value>"); SetMoney(id, value); foundOption = true; } else if(!strcmp(option, "level", true)) { if(id == INVALID_PLAYER_ID) return Syntax(playerid, "/set level <playerid> <value>"); UpdateVar(playerid, "Level", value); foundOption = true; } if(!foundOption) SCM(playerid, COLOR_SERVER, "Options: {FFFFFF}money, level"); return 1; }