Creating an array at the bottom of script
#1

Hello,

I am currently working on a new filterscript which uses an multidimensional array of about 10.000 coordinates:

Example:
pawn Код:
new Float:Example[][5] =
{
    {1682.0, 739.0, -2780.0, 116.0, 2.0},
    {1387.0, 182.0, -860.0, 142.0, 2.0},
    {-2116.0, 1312.0, 304.0, 234.0, 2.0},
    {-2436.0, 719.0, -681.0, 45.0, 2.0},
    {2936.0, -986.0, -2468.0, 226.0, 2.0},
    {462.0, 2159.0, -2953.0, 102.0, 2.0},
    {-2808.0, 1295.0, -2112.0, 197.0, 2.0},
    //10.000 more lines....
};
Since it's a huge amount of lines, you have to scroll a long way to reach my callbacks and other functions. Putting this array at the bottom of my script will give me errors ("Undefined symbol").

So I was wondering, is there some way so I can put this array at the bottom of the script?

Thank you!
Reply
#2

No, sadly. The script needs to read the array first, if it doesn't it'll say it's undefined.
Reply
#3

put that in a include, simply create a new txt file put #include <a_samp> and write the array in there and save it as array.inc or something like that, save it to the folder pawno/includes. In your gm/fs put #include <array>
Reply
#4

Thank you very much!
Reply
#5

you're welcome, btw, since it's an include you don't need it with the amx file when it's to put it in the server, just sayin' xD
Reply
#6

Definitely the way to go I do the same thing if the amount of data is going to be excessive it makes sense and if you want to change data sets for testing you only need to edit one line to select a different include.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)