SA-MP Forums Archive
Help Please - 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 Please (/showthread.php?tid=190695)



Help Please - G*Mafia - 16.11.2010

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!


Re: Help Please - Ironboy500[TW] - 16.11.2010

Post your code.


Re: Help Please - G*Mafia - 16.11.2010

What code? srry im new to scripting


Re: Help Please - iggy1 - 16.11.2010

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


Re: Help Please - G*Mafia - 16.11.2010

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)));


Re: Help Please - iggy1 - 16.11.2010

Is the error on the format line?


Re: Help Please - G*Mafia - 16.11.2010

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.


Re: Help Please - iggy1 - 16.11.2010

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


Re: Help Please - G*Mafia - 16.11.2010

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


Re: Help Please - iggy1 - 16.11.2010

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"