SA-MP Forums Archive
Help? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help? (/showthread.php?tid=187242)



Help? - Luis- - 01.11.2010

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



Re: Help? - WillyP - 01.11.2010

Change 'text' to cmdtext


I'm not sure..


Re: Help? - Luis- - 01.11.2010

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


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


Re: Help? - WillyP - 01.11.2010

Oh sorry, I just realised :P


Re: Help? - BMUK - 01.11.2010

new idx,tmp[255];


Re: Help? - Luis- - 01.11.2010

Fixed it!


Re: Help? - Brian_Furious - 01.11.2010

This is the PR-RP script xD


Re: Help? - Scenario - 01.11.2010

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


Re: Help? - BMUK - 02.11.2010

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


Re: Help? - Scenario - 02.11.2010

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.