28.11.2009, 01:03
Let's say I made a /spec <ID> command, but if I also wanted the player to do "/spec off", how would I do that in sscanf?
new tmpstr[32]; if(sscanf(x,"s",tmpstr)) return //bla... if(IsNumeric(tmpstr)){ new id = strval(tmpstr); //bla,.. }else{ if(!strcmp(tmpstr,"off",true){ //bla... } }
new id; if(sscanf(x,"u",id)){ new str[32]; if(sscanf(x,"s",str)) return //bla if(!strcmp//bla } //bla
if(!isnull(params) && strcmp(params, "off", true) == 0) {
//exit spec
return 1;
}
new id;
if(sscanf(params, "u", id) || id == INVALID_PLAYER_ID) {
// invalid player
return 1;
}
// spec the player