27.04.2018, 12:23
well in php you can use switch for strings, but pwn doesn't allow it.
and i would suggest you to use pawn.cmd fastest command engine.
and i would suggest you to use pawn.cmd fastest command engine.
PHP код:
CMD:set(pid,p[]){
if(sscanf(p,"us[30]d",id,p,val)){
scm(pid,-1,"/set <playerid> <option> <value>");
return scm(pid,-1,"options: money, level";
}
if(!IsPlayerConnected(id))return scm(pid,-1,"player isn't connected.");
if(!strcmp(p,"money")){
SetMoney(id, val);
}else if(!strcmp(p,"level")){
if(lvl < 0)return scm(pid,-1,"Level can't be lower then 0!");
UpdateVar(id, "Level", val);
}
return 1;
}