Stock issue
#1

Hi. I'm trying to get my faction ini files to load when I start my gamemode, but when I add the function anywhere in my script, pawno fails to compile and gives me 26 errors. Could anyone help me see what's wrong?

OnGameModeInit
Код:
	LoadFactions();
Stock
Код:
stock LoadFactions(){
    new Factionfile[128];
    for(new i=1; i<MAX_FACTIONS; i++){
       format(Factionfile, sizeof(Factionfile), "factions/%d.ini", i);
       new INI:File = INI_Open(Factionfile);
       INI_String("Faction Name",FactionInfo[i][fName], 128);
       INI_Int("Faction Type",FactionInfo[i][fType]);
       INI_Int("Total Members",FactionInfo[i][fMembers]);
       INI_Close();
    }
}
I've tried placing LoadFactions(); to work as a command aswell but the same problem occurred.
Reply
#2

How about you give us the errors that it shows you and by the way, the error may even be outside of the stock, smth like that could happen if u miss a bracket somewhere
Reply
#3

Right.

All these lines refer to the stock code.

Код:
D:\GTA Server\gamemodes\x.pwn(4908) : error 017: undefined symbol "name"
D:\GTA Server\gamemodes\x.pwn(4908) : error 017: undefined symbol "value"
D:\GTA Server\gamemodes\x.pwn(4909) : error 017: undefined symbol "name"
D:\GTA Server\gamemodes\x.pwn(4909) : error 017: undefined symbol "value"
D:\GTA Server\gamemodes\x.pwn(4910) : error 017: undefined symbol "name"
D:\GTA Server\gamemodes\x.pwn(4910) : error 017: undefined symbol "value"
D:\GTA Server\gamemodes\x.pwn(4911) : error 017: undefined symbol "name"
D:\GTA Server\gamemodes\x.pwn(4911) : error 017: undefined symbol "value"
D:\GTA Server\gamemodes\x.pwn(4912) : error 017: undefined symbol "name"
D:\GTA Server\gamemodes\x.pwn(4912) : error 017: undefined symbol "value"
D:\GTA Server\gamemodes\x.pwn(4913) : error 017: undefined symbol "name"
D:\GTA Server\gamemodes\x.pwn(4913) : error 017: undefined symbol "value"
Reply
#4

but it doesnt say that the stock code is the problem, right? So, it isn't.
Reply
#5

All the error lines go to the stock code. It's not being able to read the "FactionInfo[blablabla]" part, but I have no idea how to get it to read it.
Since it's a stock, if I remove the LoadFactions(); from the script, it won't give me any errors and it will compile fine. But I gotta find a way to make the factions load.
Reply
#6

but "name" and "value" arent used in LoadFactions, so that doesnt makes sense and the fault is somewhere else
Reply
#7

I would suggest you to start using mysql, because its much easier to handle and its faster, when loading many things at same time.
Reply
#8

I fixed it by using ParseFile and a public instead of a stock. It's working fine now.
Thank you for the assistance, everyone.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)