Server's gonna to be dead
#1

I've got a problem ... First , lemme show you the cmd

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;
                }
            }
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]
Reply
#2

i don't want to MAKE SPAM , but , could somebady help me ?
Reply
#3

Let's start from trying to fix the identitation
Reply
#4

If i type /writenote 1 <24Characters> it works , but if i type /writenote 1 <25+ Characters> it don't works

I've tryed to change the new result[64] into [128] or [256] , but same problem
Reply
#5

You have defined that the max size of the result is 64 and on strmid function the max size is 256. Maybe that is the problem?
Reply
#6

Oh, finnaly i've made it . Topic Closed.
Reply
#7

Quote:
Originally Posted by Danut
Oh, finnaly i've made it . Topic Closed.
Your not even gonna thank Dujma? Nice.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)