20.10.2012, 22:35
Before i start keep in mind i know nearly nothing about sscanf.
I decided to make a help command with categories:
and most of the time it works (except anim and sometimes helpful) but i recently noticed this in the logs whenever someone types the command:
Can someone with more experience please help?
I decided to make a help command with categories:
Код:
CMD:help(playerid, params[]) { new option[5]; if(!sscanf(params, "s", option)) { if(strcmp(option,"cheat",true) == 0) { SendClientMessage(playerid,COLOR_YELLOW, "CHEAT COMMANDS: stuff"); return 1; } if(strcmp(option,"fun",true) == 0) { SendClientMessage(playerid,COLOR_YELLOW, "FUN COMMANDS: stuff"); return 1; } if(strcmp(option,"prop",true) == 0) { SendClientMessage(playerid,COLOR_YELLOW, "PROP COMMANDS: stuff"); return 1; } if(strcmp(option,"anim",true) == 0) { SendClientMessage(playerid,COLOR_YELLOW, "ANIMATION COMMANDS: stuff"); return 1; } if(strcmp(option,"helpful",true) == 0) { SendClientMessage(playerid,COLOR_YELLOW, "HELPFUL COMMANDS: stuff"); return 1; } else return SendClientMessage(playerid, 0xFFFFFFFF, "Invalid Help Function!"); } else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /help [stuff here]"); }
Код:
sscanf warning: Strings without a length are deprecated, please add a destination