12.03.2013, 21:25
Well, I've been following a tutorial on how to use ZCMD and sscanf and in the tutorial, they made a /me command but when I followed it I noticed a few unnecessary parts so I removed them.
When I used the command everything worked just fine and I was like "lol, what did he add those lines"
When I exited the server, I noticed a warning in the console saying: "sscanf warning: Strings without a length are depracated, please add a destination size".
Then I coppied the tutorial's /me command and the command worked just fine, but again.. I noticed the console with warnings, this time several warnings, so I just removed their parts and made the command by my way.
Anyway.. I still got that warning and I can not find a way to solve it; here's the code:
If I done anything wrong please tell me. I am just starting to learn how to use ZCMD and sscanf and converting all my script into it so any tip will be appreciated!
When I used the command everything worked just fine and I was like "lol, what did he add those lines"
When I exited the server, I noticed a warning in the console saying: "sscanf warning: Strings without a length are depracated, please add a destination size".
Then I coppied the tutorial's /me command and the command worked just fine, but again.. I noticed the console with warnings, this time several warnings, so I just removed their parts and made the command by my way.
Anyway.. I still got that warning and I can not find a way to solve it; here's the code:
pawn Код:
CMD:me(playerid, params[])
{
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params, "s", str)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /me [text]");
format(s, sizeof(s), "* %s %s", pname, str);
SendClientMessageToAll(COLOR_RED, s);
return 1;
}
If I done anything wrong please tell me. I am just starting to learn how to use ZCMD and sscanf and converting all my script into it so any tip will be appreciated!