PDA

View Full Version : Stock issue


cuzido
26/02/2016, 03:52 PM
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.

BiosMarcel
26/02/2016, 03:57 PM
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

cuzido
26/02/2016, 04:04 PM
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"

BiosMarcel
26/02/2016, 04:06 PM
but it doesnt say that the stock code is the problem, right? So, it isn't.

cuzido
26/02/2016, 04:10 PM
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.

BiosMarcel
26/02/2016, 04:12 PM
but "name" and "value" arent used in LoadFactions, so that doesnt makes sense and the fault is somewhere else

CodeStyle175
26/02/2016, 04:16 PM
I would suggest you to start using mysql, because its much easier to handle and its faster, when loading many things at same time.

cuzido
26/02/2016, 04:56 PM
I fixed it by using ParseFile and a public instead of a stock. It's working fine now.
Thank you for the assistance, everyone.