Script loads 200 factions...
#1

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?
Reply
#2

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^^
Reply
#3

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++)
Reply
#4

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)