13.03.2009, 16:19
I've got a problem ... First , lemme show you the cmd
If i type a text between 0 and above 25 , it works & saved perfectly. But , if i type a text with 26 letters , BAM , server recive that Error " Don't Send ... "
[Pastebin]
pawn Код:
if(strcmp(cmd,"/writenote",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You aren't logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE,"USAGE: /writenote (1 - 5) [text]");
return 1;
}
else if (strcmp("1", tmp, true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /writenote (1 - 5) [TEXT]");
return 1;
}
if(PlayerInfo[playerid][N1slot] == 0)
{
strmid(PlayerInfo[playerid][N1], result, 0, strlen(result), 256);
PlayerInfo[playerid][N1slot] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Note 1 created successfuly.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your Note 1 it's aleardy written.");
return 1;
}
}
[Pastebin]