Script loads 200 factions... - 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: Script loads 200 factions... (
/showthread.php?tid=378908)
Script loads 200 factions... -
Devix - 19.09.2012
Hey!
I have created 5 factions and I want to load them with:
Код:
for(new s = 0; s < sizeof(FactionInfo); s++)
{
new FaFile[35];
format(FaFile, 35, "Factions/%i.ini" ,s);
if(INI_Exists(FaFile) == 1)
{
INI_ParseFile(FaFile, "LoadFactions", .bExtra = true, .extra = s);
}
}
But it loads 200 factions with nothing in it!
How can I solve this?
Re: Script loads 200 factions... -
arvifilter - 20.09.2012
well,try to check if sizeof(FactionInfo) is really 5.
If I were you I would define something like MAX_FACTIONS and use it for the s^^
Re: Script loads 200 factions... -
Blasphemy - 20.09.2012
Your problem is FactionInfo.
If you want to loop through 5 files in that directory simply do:
pawn Код:
for(new s = 0; s < 5; s++)
Re: Script loads 200 factions... -
[ABK]Antonio - 20.09.2012
Quote:
Originally Posted by Blasphemy
Your problem is FactionInfo.
If you want to loop through 5 files in that directory simply do:
pawn Код:
for(new s = 0; s < 5; s++)
|
Though the size of FactionInfo is probably 200, looping through 5 isn't really a good solution. If he created another one it would simply not load the 6th one (number 5) because it's til 5 instead of the max amount of factions.
Re: Script loads 200 factions... -
Blasphemy - 20.09.2012
FactionInfo is a variable.
Lets say FactionInfo is 200, he can do either:
pawn Код:
for(new s = 0; s < 200; s++)
or
pawn Код:
for(new s = 0; s < FactionInfo; s++)
Then to the server thinks its the same thing, which will only eliminate another process in his debug process.Making his next step to make sure that variable is used correctly.
Either way, i cant see FactionInfo holding 5 different kinds of values, FactionInfo is the problem.