Stock issue - 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)
+--- Thread: Stock issue (
/showthread.php?tid=601783)
Stock issue -
cuzido - 26.02.2016
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
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.
Re: Stock issue -
BiosMarcel - 26.02.2016
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
Re: Stock issue -
cuzido - 26.02.2016
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"
Re: Stock issue -
BiosMarcel - 26.02.2016
but it doesnt say that the stock code is the problem, right? So, it isn't.
Re: Stock issue -
cuzido - 26.02.2016
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.
Re: Stock issue -
BiosMarcel - 26.02.2016
but "name" and "value" arent used in LoadFactions, so that doesnt makes sense and the fault is somewhere else
Re: Stock issue -
CodeStyle175 - 26.02.2016
I would suggest you to start using mysql, because its much easier to handle and its faster, when loading many things at same time.
Re: Stock issue -
cuzido - 26.02.2016
I fixed it by using ParseFile and a public instead of a stock. It's working fine now.
Thank you for the assistance, everyone.