Problem with array size - 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: Problem with array size (
/showthread.php?tid=188417)
Problem with array size -
RenisiL - 07.11.2010
Problem solved by me idea.
Re: Problem with array size -
Mauzen - 07.11.2010
Looks like the size of TextasTD is too small/too big. You can also set string1 = string2 if they have exactly the same size. Else you have to use format.
So set the size of TextasTD to 256 and it should work.
Re: Problem with array size -
RenisiL - 07.11.2010
how it would look?
Re: Problem with array size -
Miguel - 07.11.2010
pawn Код:
strcpy(TextasTD, string, sizeof(TextasTD));
Re: Problem with array size -
RenisiL - 07.11.2010
hmm..
Код:
FreeRoam/Stock.pwn(356) : error 017: undefined symbol "strcpy"
FreeRoam/Stock.pwn(356) : warning 202: number of arguments does not match definition
Re: Problem with array size -
The_Moddler - 07.11.2010
pawn Код:
new string[128];
format(string, 128, "%s~n~%s", TextasTD, text);
TextDrawSetString(Teleportas, string);
strcat(TextasTD, string, 128);
KillTimer(LaikasTD);
LaikasTD = SetTimer("TDTeleportai" ,6000 ,false);
Re: Problem with array size -
Miguel - 07.11.2010
Quote:
Originally Posted by RenisiL
hmm..
Код:
FreeRoam/Stock.pwn(356) : error 017: undefined symbol "strcpy"
FreeRoam/Stock.pwn(356) : warning 202: number of arguments does not match definition
|
pawn Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)