19.08.2012, 16:49
(
Последний раз редактировалось Jucu; 19.08.2012 в 20:09.
)
[EDIT] Simplified, hoping people will understand now.
I have a function that returns an Array of data, I have that function in an INC file, and i'm including it into a gamemode. Although, I can't get the Array returned by the function to the gamemode, this is what i'm doing :
But then I get the following errors :
Long part with the function below.
__________________________________________________ _____________________________
That's for the function (It's in an .inc), it seems to be working, but then I need to pass that information to a the gamemode, so i'm doing this :
But then I get the following errors :
Line 30 is the unique line linking to the function in the gamemode.
I have tried many ways of doing it, such as specifying the lenght of the array, etc, nothing works.
Any help appreciated
I have a function that returns an Array of data, I have that function in an INC file, and i'm including it into a gamemode. Although, I can't get the Array returned by the function to the gamemode, this is what i'm doing :
pawn Код:
{LINE 30} new information[] = GetInformation();
Код:
main.pwn(30) : error 008: must be a constant expression; assumed zero main.pwn(30) : error 036: empty statement
__________________________________________________ _____________________________
pawn Код:
new first[128], second[128], third[128];
INI:servercfg[main](name[], value[])
{
INI_String("first", first, sizeof (first));
INI_String("second", second, sizeof (second));
INI_String("third", third, sizeof (third));
return 1;
}
stock GetInfo()
{
enum Info
{
firstEX,
secondEX,
thirdEX,
}
new ServerInfo[Info];
INI_Load("config.ini");
strcat(ServerInfo[firstEX], first, sizeof(first));
strcat(ServerInfo[secondEX], second, sizeof(second));
strcat(ServerInfo[thirdEX], third, sizeof(third));
return ServerInfo;
}
pawn Код:
{LINE 30} new information[] = GetInformation();
Код:
main.pwn(30) : error 008: must be a constant expression; assumed zero main.pwn(30) : error 036: empty statement
I have tried many ways of doing it, such as specifying the lenght of the array, etc, nothing works.
Any help appreciated