Anyone know how to fix this??
#1

Код:
gamemodes\udmlv2.pwn(3693) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4066) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4398) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4756) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4765) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4801) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4870) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(4966) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5034) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5043) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5074) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5083) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5114) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5123) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5153) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5162) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5215) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5262) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5270) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5381) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5391) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5402) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5428) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5437) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5460) : error 047: array sizes do not match, or destination array is too small
gamemodes\udmlv2.pwn(5469) : error 047: array sizes do not match, or destination array is too small

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Код:
\gamemodes\udmlv2.pwn(3693) : error 047: array sizes do not match, or destination array is too small
\gamemodes\udmlv2.pwn(4066) : error 047: array sizes do not match, or destination array is too small
\gamemodes\udmlv2.pwn(4398) : error 047: array sizes do not match, or destination array is too small
3693: tmp = strtok(cmdtext, idx);
4060: tmp = strtok(cmdtext, idx);
4398: tmp = strtok(cmdtext, idx);

^^^^^^
The lines are pretty much all the same.

new tmp[125];

I had "strtok" defined but removed it because I got another error saying it was "Already Defined".
I can't remember why this error started occurring...But I really can't figure out how to fix it. Someone please help.

If this comes to any help,I'm using these include files
#include <core>
#include <float>
#include <dini>
#include <dudb>
#include <utils>
Reply
#2

show me how u defined idx

and also cmdtext
Reply
#3

check the array sizes that you're using, make sure that wherever you assign them is larger or equal to where you get the data from. can you post those lines which says there's an error?
Reply
#4

Quote:
Originally Posted by spd_sahil
Посмотреть сообщение
show me how u defined idx

and also cmdtext
new idx;
new cmd[256];
new tmp[250];
cmd = strtok(cmdtext, idx);

cmdtext is defined under OnPlayerCommandText(playerid, cmdtext[]) ? Isn't it...
Reply
#5

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
check the array sizes that you're using, make sure that wherever you assign them is larger or equal to where you get the data from. can you post those lines which says there's an error?
Код:
\gamemodes\udmlv2.pwn(3693) : error 047: array sizes do not match, or destination array is too small
\gamemodes\udmlv2.pwn(4066) : error 047: array sizes do not match, or destination array is too small
\gamemodes\udmlv2.pwn(4398) : error 047: array sizes do not match, or destination array is too small
3693: tmp = strtok(cmdtext, idx);
4060: tmp = strtok(cmdtext, idx);
4398: tmp = strtok(cmdtext, idx);

There is 26 total...They are all pretty much the same as the three above
Reply
#6

Sorry for so many replies :P Just want to keep my post organized and easy to understand...
Anyway so I figured out that those errors were occurring because of the include
#include <dudb>

I'm still not completely sure why,so if anyone could still figure out the solution that would be so great
Reply
#7

Quote:
Originally Posted by Passout
Посмотреть сообщение
new idx;
new cmd[256];
new tmp[250];
cmd = strtok(cmdtext, idx);

cmdtext is defined under OnPlayerCommandText(playerid, cmdtext[]) ? Isn't it...
they're too big in my opinion when it comes to command string lengths. try using equal sizes for both, that might be able to fix it.

pawn Код:
new cmd[128], tmp[128];

// alternatively...

new cmd[64], tmp[64];
Reply
#8

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
they're too big in my opinion when it comes to command string lengths. try using equal sizes for both, that might be able to fix it.

pawn Код:
new cmd[128], tmp[128];

// alternatively...

new cmd[64], tmp[64];
I'll give that a try...but the error was being caused by some include...Everything was fine the way it was until I started attempting certain things with a filter-script..
Reply
#9

Quote:
Originally Posted by Passout
Посмотреть сообщение
I'll give that a try...but the error was being caused by some include...Everything was fine the way it was until I started attempting certain things with a filter-script..
if it was an include that messes up your script, try putting in the function itself into your script.

pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)