#1

I am getting an Error I have never had before with this code;
pawn Код:
case 2: // Age check
                    {
                        new idx,tmp[128];
                        tmp = strtok(text, idx); // Line 665
                        new check = strval(tmp);
                        if(check < 10 || check > 100)
                        {
                            SendClientMessage(playerid, COLOR_GRAY, "SERVER: Cannot go under 10 or above 100.");
                            return 0;
                        }
                        PlayerInfo[playerid][pAge] = check;
                        PlayerInfo[playerid][pTutorialStep] = 3;
                        format(string, sizeof(string), "INFO: Ok, so you are a %d year old.",PlayerInfo[playerid][pAge]);
                        SendClientMessage(playerid,COLOR_RED,string);
                        SendClientMessage(playerid, COLOR_RED, "QUESTION: What is the full word of DM?");
                       SendClientMessage(playerid, COLOR_WHITE, "- Type in the awnser without any spaces -");
                        return 0;
                    }
Код:
C:\Users\BooNii3\Foxx RP\Foxx Role Play\Server\gamemodes\foxxrp.pwn(665) : error 047: array sizes do not match, or destination array is too small
Reply
#2

Change 'text' to cmdtext


I'm not sure..
Reply
#3

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Change 'text' to cmdtext


I'm not sure..
Nah it don't work, It is a OnPlayerText do
Reply
#4

Oh sorry, I just realised :P
Reply
#5

new idx,tmp[255];
Reply
#6

Fixed it!
Reply
#7

This is the PR-RP script xD
Reply
#8

Quote:
Originally Posted by BMUK
Посмотреть сообщение
new idx,tmp[255];
That's bad advice. You shouldn't really need a cell size like that, ever.
Reply
#9

He doesnt care about cell sizes. He just wanted the error gone so he got what he asked for.

Perhaps you could explain to him why he wont need [MAX_STRING] (or) [255] ? Although he doesnt care.. lol
Reply
#10

Quote:
Originally Posted by BMUK
Посмотреть сообщение
He doesnt care about cell sizes. He just wanted the error gone so he got what he asked for.

Perhaps you could explain to him why he wont need [MAX_STRING] (or) [255] ? Although he doesnt care.. lol
Simply because you are using more cells then you actually need and it's wasting RAM. If anything, 128 would be appropriate. I won't go into detail though, as I'd have to double check on that one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)