Quote:
Originally Posted by Kindred
If, by any chance, you are looking for another one using sscanf, here's an example:
pawn Код:
CMD:help(playerid, params[]) { new option; if(sscanf(params, "s", option)) return SendClientMessage(playerid, -1, "Usage: /help <account/map>"); if(strcmp(name,"account",false)==0) { //Account code } if(strcmp(name,"map",false)==0) { //map code } else return SendClientMessage(playerid, -1, "Invalid option!"); return 1; }
Simple enough, I suppose. No use explaining it, it's kinda self explanatory as long as you know the basics of scripting.
|
That would not work. You didn't specify 'option' as a string, and didn't specify it in the sscanf code.
pawn Код:
new option[32];
if(sscanf(params, "s[32]", option))
Is what you should have done.