27.04.2018, 12:19
Sooooo... i can make this command:
with SWITCH?
I tried something like switch(params) { case money:{} } but i'm getting error.
Код:
YCMD:set(playerid, params[], help) { if(playerVariables[playerid][pAdmin] <= 4) return AdminOnly(playerid, 5); if (isnull(params)) { Syntax(playerid, "/set <option> <playerid> <value>"); SCM(playerid, COLOR_SERVER, "Options: {FFFFFF}money, level"); return 1; } new toplayerid, value; if (!strcmp(params, "money", true, 5)) { if(sscanf(params[5], "ui", toplayerid, value)) return Syntax(playerid, "/set money <playerid> <value>"); if(toplayerid == INVALID_PLAYER_ID) return Syntax(playerid, "/set money <playerid> <value>"); SetMoney(toplayerid, value); return 1; } if (!strcmp(params, "level", true, 5)) { if(sscanf(params[5], "ui", toplayerid, value)) return Syntax(playerid, "/set level <playerid> <value>"); if(toplayerid == INVALID_PLAYER_ID) return Syntax(playerid, "/set level <playerid> <value>"); UpdateVar(playerid, "Level", value); return 1; } return 1; }
I tried something like switch(params) { case money:{} } but i'm getting error.