23.05.2012, 15:25
Hello.
I've got a little problem with sscanf 2.6 - it's about the string. Let me show the code first:
It's a testing message. Problem is that when I try to ban myself, it shows ~30 characters in a reason instead 128 like I did in "us[128]". If I would ban a player with 5 more characters than in my nickname, it would allow to show 5 less symbols in the end. If I input too much letters in a reason, this message won't show. Could anyone help me with that to allow sending a message in chat which would show all symbols in a reason?
PS: I use 256 cells because I also use colour embedding and sometimes 128 isn't enough (sentence 'breaks' in the end).
I've got a little problem with sscanf 2.6 - it's about the string. Let me show the code first:
Код:
new playerid2, reason[128]; if(!sscanf(params, "us[128]", playerid2, reason)) { new string[256]; format(string,sizeof(string),"[INFO]{C0C0C0} Player {FFFF00}%s (ID %d){C0C0C0} has been banned by {FFFF00}%s (ID %d){C0C0C0} (Reason: %s)!",GetName(playerid2),playerid2,GetName(playerid),playerid,reason); SendClientMessageToAll(yellow,string); } else return SendClientMessage(playerid,red,"[USAGE]{C0C0C0} /ban [playerid] [reason]");
PS: I use 256 cells because I also use colour embedding and sometimes 128 isn't enough (sentence 'breaks' in the end).