28.11.2009, 05:52
Neither of those will work properly; the first will not work for parts of a player's name, and the second will not return true for "/spec off" (id will just be set to INVALID_PLAYER_ID).
You might want to consider just using just "/spec" to exit spectate mode, since someone might have the name "off".
pawn Код:
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