SA-MP Forums Archive
i want a Little help in script - 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)
+--- Thread: i want a Little help in script (/showthread.php?tid=529055)



i want a Little help in script - chintan - 31.07.2014

i downloaded an rp server...i have set it up nicely with all plugins and scriptfiles..but there is alittle error which i m not getting..how to solve this please tell me

Code:
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(25116) : error 021: symbol already defined: "strtok"
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(25131) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(26656) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(26716) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(26769) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(27437) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(27496) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28177) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28205) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28216) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28276) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28545) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28572) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28602) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28610) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28644) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28652) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28685) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28730) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28793) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28851) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28859) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28894) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(28902) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(29129) : error 047: array sizes do not match, or destination array is too small
C:\Users\hp\Downloads\Raven roleplay\gamemodes\larp.pwn(29183) : 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.



Re: i want a Little help in script - chintan - 31.07.2014

line (25116) strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}






line (25131) is 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;
}


Respuesta: i want a Little help in script - ghost556 - 31.07.2014

have you tried to add more on the array?

pawn Code:
new result[100];



Re: i want a Little help in script - Ritzy2K - 31.07.2014

For example.. its like..
Quote:

new destination[8];
new msg[] = "Hello World!";

destination = msg;

it had errros same as yours... change it to..

Quote:

new destination[13];
new msg[] = "Hello World!";

destination = msg;

For array assignment, the arrays on the left and the right side of the assignment operator must have the same number of dimensions. In addition:
for multi-dimensional arrays, both arrays must have the same size;
for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.

In the above code, we try to fit 12 characters in an array that can only support 8. By increasing the array size of the destination, we can solve this. Note that a string also requires a null terminator so the total length of "Hello World!" plus the null terminator is, in fact, 13...


Re: i want a Little help in script - chintan - 31.07.2014

hmm let me try
thnx