Help Please
#1

Compile Probleam

C:\Users\MarioG\Desktop\Server\gamemodes\CM.pwn(10 62) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Please help me!
Reply
#2

Post your code.
Reply
#3

What code? srry im new to scripting
Reply
#4

Post line 1062 of your code. Maybe few lines above and below too. The error is because you are using an incorrect size array.
Reply
#5

ok This is line 1046 - 1072

format(string, sizeof(string),"%s [TeamChat]: %s", playername, gangChat);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SendClientMessage(i, COLOR_YELLOW, string);
}
}
return 0;
}
return 1;
}
dcmd_spec(playerid, params[])
{
new tmp[MAX_STRING];
new index = 0;
tmp = strtok(params, index);
if(!strlen(tmp))
{
SystemMessage(playerid, "USAGE: /spec [ID]");
return 1;
}
new string[MAX_STRING];
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "%s is spectating %s.", PlayerN(playerid), PlayerN(giveplayerid)));
Reply
#6

Is the error on the format line?
Reply
#7

what? dunno thats the error that shows up when i compile:



C:\Users\MarioG\Desktop\Server\gamemodes\CM.pwn(10 62) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

C:\Users\MarioG\Desktop\Server\gamemodes\CM.pwn(10 62) 1062 = the line the error is on. If you cant understand the simplest thing like that you need to go back to the basics. I can't realy help if you don't understand what i'm saying
Reply
#9

ok listen this line 1062

tmp = strtok(params, index);

i tried to remove it then compile and it worked. so how can i compile it with the line 1062 > what shall i do
Reply
#10

It might be something wrong with the size of "new tmp[MAX_STRING];" What is MAX_STRING defined as?

at the top of your code you will have something like this,
pawn Код:
#define MAX_STRING
Tell me the number that comes after that.^^
I have very little experience with strtok so might not be able to help#

EDIT: Well the error is saying that thers something wrong with the size of "tmp"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)