YINI help
#1

Hey, i got problem with loading family vehicles, so i decided to printf the loading and found out that the loading function spams the server log with about 20k lines only with this: (see spamming below)

I got 14 families in total and each family has 8 vehicles in total.
The loading problem it loads from 0-13 to familyid, from 0-7 for each familyid vehicles, but the loading 0-13 times is 20k lines as it prints.

Loading function:
Код:
INI_Load(FAMILYHQPATH, .bLocal = false);
Loading Code:

Код:
INI:familieshq[FamilyCars](name[], value[])
{
	for(new f = 0; f < MAX_FAMILY; f++)
	{
		for(new fv = 0; fv < MAX_GANG_VEHICLES; fv++)
		{
			new var[32];
			format(var, 32, "Family%dVeh%dModelId", f, fv);
			INI_Int(var, FamilyVehicleInfo[f][fv][fvModelId]);
			printf(var);
	}
	}
	return 1;
}
What it prints in the server log: (small part of the prints)

Код:
[07/02/2015 10:33:07] Family0Veh0ModelId
[07/02/2015 10:33:07] Family0Veh1ModelId
[07/02/2015 10:33:07] Family0Veh2ModelId
[07/02/2015 10:33:07] Family0Veh3ModelId
[07/02/2015 10:33:07] Family0Veh4ModelId
[07/02/2015 10:33:07] Family0Veh5ModelId
[07/02/2015 10:33:07] Family0Veh6ModelId
[07/02/2015 10:33:07] Family0Veh7ModelId
[07/02/2015 10:33:07] Family1Veh0ModelId
[07/02/2015 10:33:07] Family1Veh1ModelId
[07/02/2015 10:33:07] Family1Veh2ModelId
[07/02/2015 10:33:07] Family1Veh3ModelId
[07/02/2015 10:33:07] Family1Veh4ModelId
[07/02/2015 10:33:07] Family1Veh5ModelId
[07/02/2015 10:33:07] Family1Veh6ModelId
[07/02/2015 10:33:07] Family1Veh7ModelId
[07/02/2015 10:33:07] Family2Veh0ModelId
[07/02/2015 10:33:07] Family2Veh1ModelId
[07/02/2015 10:33:07] Family2Veh2ModelId
[07/02/2015 10:33:07] Family2Veh3ModelId
[07/02/2015 10:33:07] Family2Veh4ModelId
[07/02/2015 10:33:07] Family2Veh5ModelId
[07/02/2015 10:33:07] Family2Veh6ModelId
[07/02/2015 10:33:07] Family2Veh7ModelId
[07/02/2015 10:33:07] Family3Veh0ModelId
[07/02/2015 10:33:07] Family3Veh1ModelId
[07/02/2015 10:33:07] Family3Veh2ModelId
[07/02/2015 10:33:07] Family3Veh3ModelId
[07/02/2015 10:33:07] Family3Veh4ModelId
[07/02/2015 10:33:07] Family3Veh5ModelId
[07/02/2015 10:33:07] Family3Veh6ModelId
[07/02/2015 10:33:07] Family3Veh7ModelId
[07/02/2015 10:33:07] Family4Veh0ModelId
[07/02/2015 10:33:07] Family4Veh1ModelId
[07/02/2015 10:33:07] Family4Veh2ModelId
[07/02/2015 10:33:07] Family4Veh3ModelId
[07/02/2015 10:33:07] Family4Veh4ModelId
[07/02/2015 10:33:07] Family4Veh5ModelId
[07/02/2015 10:33:07] Family4Veh6ModelId
[07/02/2015 10:33:07] Family4Veh7ModelId
[07/02/2015 10:33:07] Family5Veh0ModelId
[07/02/2015 10:33:07] Family5Veh1ModelId
[07/02/2015 10:33:07] Family5Veh2ModelId
[07/02/2015 10:33:07] Family5Veh3ModelId
[07/02/2015 10:33:07] Family5Veh4ModelId
[07/02/2015 10:33:07] Family5Veh5ModelId
[07/02/2015 10:33:07] Family5Veh6ModelId
[07/02/2015 10:33:07] Family5Veh7ModelId
[07/02/2015 10:33:07] Family6Veh0ModelId
[07/02/2015 10:33:07] Family6Veh1ModelId
[07/02/2015 10:33:07] Family6Veh2ModelId
[07/02/2015 10:33:07] Family6Veh3ModelId
[07/02/2015 10:33:07] Family6Veh4ModelId
[07/02/2015 10:33:07] Family6Veh5ModelId
[07/02/2015 10:33:07] Family6Veh6ModelId
[07/02/2015 10:33:07] Family6Veh7ModelId
[07/02/2015 10:33:07] Family7Veh0ModelId
[07/02/2015 10:33:07] Family7Veh1ModelId
[07/02/2015 10:33:07] Family7Veh2ModelId
[07/02/2015 10:33:07] Family7Veh3ModelId
[07/02/2015 10:33:07] Family7Veh4ModelId
[07/02/2015 10:33:07] Family7Veh5ModelId
[07/02/2015 10:33:07] Family7Veh6ModelId
[07/02/2015 10:33:07] Family7Veh7ModelId
[07/02/2015 10:33:07] Family8Veh0ModelId
[07/02/2015 10:33:07] Family8Veh1ModelId
[07/02/2015 10:33:07] Family8Veh2ModelId
[07/02/2015 10:33:07] Family8Veh3ModelId
[07/02/2015 10:33:07] Family8Veh4ModelId
[07/02/2015 10:33:07] Family8Veh5ModelId
[07/02/2015 10:33:07] Family8Veh6ModelId
[07/02/2015 10:33:07] Family8Veh7ModelId
[07/02/2015 10:33:07] Family9Veh0ModelId
[07/02/2015 10:33:07] Family9Veh1ModelId
[07/02/2015 10:33:07] Family9Veh2ModelId
[07/02/2015 10:33:07] Family9Veh3ModelId
[07/02/2015 10:33:07] Family9Veh4ModelId
[07/02/2015 10:33:07] Family9Veh5ModelId
[07/02/2015 10:33:07] Family9Veh6ModelId
[07/02/2015 10:33:07] Family9Veh7ModelId
[07/02/2015 10:33:07] Family10Veh0ModelId
[07/02/2015 10:33:07] Family10Veh1ModelId
[07/02/2015 10:33:07] Family10Veh2ModelId
[07/02/2015 10:33:07] Family10Veh3ModelId
[07/02/2015 10:33:07] Family10Veh4ModelId
[07/02/2015 10:33:07] Family10Veh5ModelId
[07/02/2015 10:33:07] Family10Veh6ModelId
[07/02/2015 10:33:07] Family10Veh7ModelId
[07/02/2015 10:33:07] Family11Veh0ModelId
[07/02/2015 10:33:07] Family11Veh1ModelId
[07/02/2015 10:33:07] Family11Veh2ModelId
[07/02/2015 10:33:07] Family11Veh3ModelId
[07/02/2015 10:33:07] Family11Veh4ModelId
[07/02/2015 10:33:07] Family11Veh5ModelId
[07/02/2015 10:33:07] Family11Veh6ModelId
[07/02/2015 10:33:07] Family11Veh7ModelId
[07/02/2015 10:33:07] Family12Veh0ModelId
[07/02/2015 10:33:07] Family12Veh1ModelId
[07/02/2015 10:33:07] Family12Veh2ModelId
[07/02/2015 10:33:07] Family12Veh3ModelId
[07/02/2015 10:33:07] Family12Veh4ModelId
[07/02/2015 10:33:07] Family12Veh5ModelId
[07/02/2015 10:33:07] Family12Veh6ModelId
[07/02/2015 10:33:07] Family12Veh7ModelId
[07/02/2015 10:33:07] Family13Veh0ModelId
[07/02/2015 10:33:07] Family13Veh1ModelId
[07/02/2015 10:33:07] Family13Veh2ModelId
[07/02/2015 10:33:07] Family13Veh3ModelId
[07/02/2015 10:33:07] Family13Veh4ModelId
[07/02/2015 10:33:07] Family13Veh5ModelId
[07/02/2015 10:33:07] Family13Veh6ModelId
[07/02/2015 10:33:07] Family13Veh7ModelId
[07/02/2015 10:33:07] Family0Veh0ModelId
[07/02/2015 10:33:07] Family0Veh1ModelId
[07/02/2015 10:33:07] Family0Veh2ModelId
[07/02/2015 10:33:07] Family0Veh3ModelId
[07/02/2015 10:33:07] Family0Veh4ModelId
[07/02/2015 10:33:07] Family0Veh5ModelId
[07/02/2015 10:33:07] Family0Veh6ModelId
[07/02/2015 10:33:07] Family0Veh7ModelId
[07/02/2015 10:33:07] Family1Veh0ModelId
[07/02/2015 10:33:07] Family1Veh1ModelId
[07/02/2015 10:33:07] Family1Veh2ModelId
[07/02/2015 10:33:07] Family1Veh3ModelId
[07/02/2015 10:33:07] Family1Veh4ModelId
[07/02/2015 10:33:07] Family1Veh5ModelId
[07/02/2015 10:33:07] Family1Veh6ModelId
[07/02/2015 10:33:07] Family1Veh7ModelId
[07/02/2015 10:33:07] Family2Veh0ModelId
[07/02/2015 10:33:07] Family2Veh1ModelId
[07/02/2015 10:33:07] Family2Veh2ModelId
[07/02/2015 10:33:07] Family2Veh3ModelId
[07/02/2015 10:33:07] Family2Veh4ModelId
[07/02/2015 10:33:07] Family2Veh5ModelId
[07/02/2015 10:33:07] Family2Veh6ModelId
[07/02/2015 10:33:07] Family2Veh7ModelId
[07/02/2015 10:33:07] Family3Veh0ModelId
[07/02/2015 10:33:07] Family3Veh1ModelId
[07/02/2015 10:33:07] Family3Veh2ModelId
[07/02/2015 10:33:07] Family3Veh3ModelId
[07/02/2015 10:33:07] Family3Veh4ModelId
[07/02/2015 10:33:07] Family3Veh5ModelId
[07/02/2015 10:33:07] Family3Veh6ModelId
[07/02/2015 10:33:07] Family3Veh7ModelId
[07/02/2015 10:33:07] Family4Veh0ModelId
[07/02/2015 10:33:07] Family4Veh1ModelId
[07/02/2015 10:33:07] Family4Veh2ModelId
[07/02/2015 10:33:07] Family4Veh3ModelId
[07/02/2015 10:33:07] Family4Veh4ModelId
[07/02/2015 10:33:07] Family4Veh5ModelId
[07/02/2015 10:33:07] Family4Veh6ModelId
[07/02/2015 10:33:07] Family4Veh7ModelId
[07/02/2015 10:33:07] Family5Veh0ModelId
[07/02/2015 10:33:07] Family5Veh1ModelId
[07/02/2015 10:33:07] Family5Veh2ModelId
[07/02/2015 10:33:07] Family5Veh3ModelId
[07/02/2015 10:33:07] Family5Veh4ModelId
[07/02/2015 10:33:07] Family5Veh5ModelId
[07/02/2015 10:33:07] Family5Veh6ModelId
[07/02/2015 10:33:07] Family5Veh7ModelId
[07/02/2015 10:33:07] Family6Veh0ModelId
[07/02/2015 10:33:07] Family6Veh1ModelId
[07/02/2015 10:33:07] Family6Veh2ModelId
[07/02/2015 10:33:07] Family6Veh3ModelId
[07/02/2015 10:33:07] Family6Veh4ModelId
[07/02/2015 10:33:07] Family6Veh5ModelId
[07/02/2015 10:33:07] Family6Veh6ModelId
[07/02/2015 10:33:07] Family6Veh7ModelId
[07/02/2015 10:33:07] Family7Veh0ModelId
[07/02/2015 10:33:07] Family7Veh1ModelId
[07/02/2015 10:33:07] Family7Veh2ModelId
[07/02/2015 10:33:07] Family7Veh3ModelId
[07/02/2015 10:33:07] Family7Veh4ModelId
[07/02/2015 10:33:07] Family7Veh5ModelId
[07/02/2015 10:33:07] Family7Veh6ModelId
[07/02/2015 10:33:07] Family7Veh7ModelId
[07/02/2015 10:33:07] Family8Veh0ModelId
[07/02/2015 10:33:07] Family8Veh1ModelId
[07/02/2015 10:33:07] Family8Veh2ModelId
[07/02/2015 10:33:07] Family8Veh3ModelId
[07/02/2015 10:33:07] Family8Veh4ModelId
[07/02/2015 10:33:07] Family8Veh5ModelId
[07/02/2015 10:33:07] Family8Veh6ModelId
[07/02/2015 10:33:07] Family8Veh7ModelId
[07/02/2015 10:33:07] Family9Veh0ModelId
[07/02/2015 10:33:07] Family9Veh1ModelId
[07/02/2015 10:33:07] Family9Veh2ModelId
[07/02/2015 10:33:07] Family9Veh3ModelId
[07/02/2015 10:33:07] Family9Veh4ModelId
[07/02/2015 10:33:07] Family9Veh5ModelId
[07/02/2015 10:33:07] Family9Veh6ModelId
[07/02/2015 10:33:07] Family9Veh7ModelId
[07/02/2015 10:33:07] Family10Veh0ModelId
[07/02/2015 10:33:07] Family10Veh1ModelId
[07/02/2015 10:33:07] Family10Veh2ModelId
[07/02/2015 10:33:07] Family10Veh3ModelId
[07/02/2015 10:33:07] Family10Veh4ModelId
[07/02/2015 10:33:07] Family10Veh5ModelId
[07/02/2015 10:33:07] Family10Veh6ModelId
[07/02/2015 10:33:07] Family10Veh7ModelId
[07/02/2015 10:33:07] Family11Veh0ModelId
[07/02/2015 10:33:07] Family11Veh1ModelId
[07/02/2015 10:33:07] Family11Veh2ModelId
[07/02/2015 10:33:07] Family11Veh3ModelId
[07/02/2015 10:33:07] Family11Veh4ModelId
[07/02/2015 10:33:07] Family11Veh5ModelId
[07/02/2015 10:33:07] Family11Veh6ModelId
[07/02/2015 10:33:07] Family11Veh7ModelId
[07/02/2015 10:33:07] Family12Veh0ModelId
[07/02/2015 10:33:07] Family12Veh1ModelId
[07/02/2015 10:33:07] Family12Veh2ModelId
[07/02/2015 10:33:07] Family12Veh3ModelId
[07/02/2015 10:33:07] Family12Veh4ModelId
[07/02/2015 10:33:07] Family12Veh5ModelId
[07/02/2015 10:33:07] Family12Veh6ModelId
[07/02/2015 10:33:07] Family12Veh7ModelId
[07/02/2015 10:33:07] Family13Veh0ModelId
[07/02/2015 10:33:07] Family13Veh1ModelId
[07/02/2015 10:33:07] Family13Veh2ModelId
[07/02/2015 10:33:07] Family13Veh3ModelId
[07/02/2015 10:33:07] Family13Veh4ModelId
[07/02/2015 10:33:07] Family13Veh5ModelId
[07/02/2015 10:33:07] Family13Veh6ModelId
[07/02/2015 10:33:07] Family13Veh7ModelId

Writing code:
Код:
for(new f = 0; f < MAX_FAMILY; f++)
	{
		for(new fv = 0; fv < MAX_GANG_VEHICLES; fv++)
		{
			new var[32], INI:File = INI_Open(FAMILYHQPATH);
			INI_SetTag(File, "FamilyCars");
			
			format(var, 32, "Family%dVeh%dModelId", f, fv);
			INI_WriteInt(File, var, FamilyVehicleInfo[f][fv][fvModelId]);
			printf(var);
}
}
return 1;
}
On writing it works properly:

Код:
[07/02/2015 10:35:21] Family0Veh0ModelId
[07/02/2015 10:35:21] Family0Veh1ModelId
[07/02/2015 10:35:21] Family0Veh2ModelId
[07/02/2015 10:35:21] Family0Veh3ModelId
[07/02/2015 10:35:22] Family0Veh4ModelId
[07/02/2015 10:35:22] Family0Veh5ModelId
[07/02/2015 10:35:22] Family0Veh6ModelId
[07/02/2015 10:35:22] Family0Veh7ModelId
[07/02/2015 10:35:22] Family1Veh0ModelId
[07/02/2015 10:35:22] Family1Veh1ModelId
[07/02/2015 10:35:22] Family1Veh2ModelId
[07/02/2015 10:35:22] Family1Veh3ModelId
[07/02/2015 10:35:22] Family1Veh4ModelId
[07/02/2015 10:35:22] Family1Veh5ModelId
[07/02/2015 10:35:22] Family1Veh6ModelId
[07/02/2015 10:35:22] Family1Veh7ModelId
[07/02/2015 10:35:22] Family2Veh0ModelId
[07/02/2015 10:35:22] Family2Veh1ModelId
[07/02/2015 10:35:22] Family2Veh2ModelId
[07/02/2015 10:35:22] Family2Veh3ModelId
[07/02/2015 10:35:22] Family2Veh4ModelId
[07/02/2015 10:35:22] Family2Veh5ModelId
[07/02/2015 10:35:22] Family2Veh6ModelId
[07/02/2015 10:35:22] Family2Veh7ModelId
[07/02/2015 10:35:22] Family3Veh0ModelId
[07/02/2015 10:35:22] Family3Veh1ModelId
[07/02/2015 10:35:22] Family3Veh2ModelId
[07/02/2015 10:35:22] Family3Veh3ModelId
[07/02/2015 10:35:22] Family3Veh4ModelId
[07/02/2015 10:35:22] Family3Veh5ModelId
[07/02/2015 10:35:23] Family3Veh6ModelId
[07/02/2015 10:35:23] Family3Veh7ModelId
[07/02/2015 10:35:23] Family4Veh0ModelId
[07/02/2015 10:35:23] Family4Veh1ModelId
[07/02/2015 10:35:23] Family4Veh2ModelId
[07/02/2015 10:35:23] Family4Veh3ModelId
[07/02/2015 10:35:23] Family4Veh4ModelId
[07/02/2015 10:35:23] Family4Veh5ModelId
[07/02/2015 10:35:23] Family4Veh6ModelId
[07/02/2015 10:35:23] Family4Veh7ModelId
[07/02/2015 10:35:23] Family5Veh0ModelId
[07/02/2015 10:35:23] Family5Veh1ModelId
[07/02/2015 10:35:23] Family5Veh2ModelId
[07/02/2015 10:35:23] Family5Veh3ModelId
[07/02/2015 10:35:23] Family5Veh4ModelId
[07/02/2015 10:35:23] Family5Veh5ModelId
[07/02/2015 10:35:23] Family5Veh6ModelId
[07/02/2015 10:35:23] Family5Veh7ModelId
[07/02/2015 10:35:23] Family6Veh0ModelId
[07/02/2015 10:35:23] Family6Veh1ModelId
[07/02/2015 10:35:23] Family6Veh2ModelId
[07/02/2015 10:35:23] Family6Veh3ModelId
[07/02/2015 10:35:24] Family6Veh4ModelId
[07/02/2015 10:35:24] Family6Veh5ModelId
[07/02/2015 10:35:24] Family6Veh6ModelId
[07/02/2015 10:35:24] Family6Veh7ModelId
[07/02/2015 10:35:24] Family7Veh0ModelId
[07/02/2015 10:35:24] Family7Veh1ModelId
[07/02/2015 10:35:24] Family7Veh2ModelId
[07/02/2015 10:35:24] Family7Veh3ModelId
[07/02/2015 10:35:24] Family7Veh4ModelId
[07/02/2015 10:35:24] Family7Veh5ModelId
[07/02/2015 10:35:24] Family7Veh6ModelId
[07/02/2015 10:35:24] Family7Veh7ModelId
[07/02/2015 10:35:24] Family8Veh0ModelId
[07/02/2015 10:35:24] Family8Veh1ModelId
[07/02/2015 10:35:24] Family8Veh2ModelId
[07/02/2015 10:35:25] Family8Veh3ModelId
[07/02/2015 10:35:25] Family8Veh4ModelId
[07/02/2015 10:35:25] Family8Veh5ModelId
[07/02/2015 10:35:25] Family8Veh6ModelId
[07/02/2015 10:35:25] Family8Veh7ModelId
[07/02/2015 10:35:25] Family9Veh0ModelId
[07/02/2015 10:35:25] Family9Veh1ModelId
[07/02/2015 10:35:25] Family9Veh2ModelId
[07/02/2015 10:35:25] Family9Veh3ModelId
[07/02/2015 10:35:25] Family9Veh4ModelId
[07/02/2015 10:35:25] Family9Veh5ModelId
[07/02/2015 10:35:25] Family9Veh6ModelId
[07/02/2015 10:35:26] Family9Veh7ModelId
[07/02/2015 10:35:26] Family10Veh0ModelId
[07/02/2015 10:35:26] Family10Veh1ModelId
[07/02/2015 10:35:26] Family10Veh2ModelId
[07/02/2015 10:35:26] Family10Veh3ModelId
[07/02/2015 10:35:26] Family10Veh4ModelId
[07/02/2015 10:35:26] Family10Veh5ModelId
[07/02/2015 10:35:26] Family10Veh6ModelId
[07/02/2015 10:35:26] Family10Veh7ModelId
[07/02/2015 10:35:26] Family11Veh0ModelId
[07/02/2015 10:35:26] Family11Veh1ModelId
[07/02/2015 10:35:27] Family11Veh2ModelId
[07/02/2015 10:35:27] Family11Veh3ModelId
[07/02/2015 10:35:27] Family11Veh4ModelId
[07/02/2015 10:35:27] Family11Veh5ModelId
[07/02/2015 10:35:27] Family11Veh6ModelId
[07/02/2015 10:35:27] Family11Veh7ModelId
[07/02/2015 10:35:27] Family12Veh0ModelId
[07/02/2015 10:35:27] Family12Veh1ModelId
[07/02/2015 10:35:27] Family12Veh2ModelId
[07/02/2015 10:35:27] Family12Veh3ModelId
[07/02/2015 10:35:28] Family12Veh4ModelId
[07/02/2015 10:35:28] Family12Veh5ModelId
[07/02/2015 10:35:28] Family12Veh6ModelId
[07/02/2015 10:35:28] Family12Veh7ModelId
[07/02/2015 10:35:28] Family13Veh0ModelId
[07/02/2015 10:35:28] Family13Veh1ModelId
[07/02/2015 10:35:28] Family13Veh2ModelId
[07/02/2015 10:35:28] Family13Veh3ModelId
[07/02/2015 10:35:28] Family13Veh4ModelId
[07/02/2015 10:35:29] Family13Veh5ModelId
[07/02/2015 10:35:29] Family13Veh6ModelId
[07/02/2015 10:35:29] Family13Veh7ModelId
+REP
Reply
#2

Probably you're calling the loading function inside a repetitive structure, so it gets called multiple times. The loading function looks fine, I mean ... I never used files to save data, but the two loops that load vehicles for each family look fine.
Reply
#3

I don't see an issue.

Quote:

[07/02/2015 10:35:21] Family0Veh0ModelId
[07/02/2015 10:35:21] Family0Veh1ModelId
[07/02/2015 10:35:21] Family0Veh2ModelId
[07/02/2015 10:35:21] Family0Veh3ModelId
[07/02/2015 10:35:22] Family0Veh4ModelId
[07/02/2015 10:35:22] Family0Veh5ModelId
[07/02/2015 10:35:22] Family0Veh6ModelId
[07/02/2015 10:35:22] Family0Veh7ModelId
[07/02/2015 10:35:22] Family1Veh0ModelId
[07/02/2015 10:35:22] Family1Veh1ModelId
[07/02/2015 10:35:22] Family1Veh2ModelId
[07/02/2015 10:35:22] Family1Veh3ModelId
[07/02/2015 10:35:22] Family1Veh4ModelId
[07/02/2015 10:35:22] Family1Veh5ModelId
[07/02/2015 10:35:22] Family1Veh6ModelId
[07/02/2015 10:35:22] Family1Veh7ModelId

This is doing exactly as you said it was doing. For each family "f" it is loading 8 family vehicles "fv." If Spam is your issue, remove the printf message.
Reply
#4

Quote:
Originally Posted by HazardouS
Посмотреть сообщение
Probably you're calling the loading function inside a repetitive structure, so it gets called multiple times. The loading function looks fine, I mean ... I never used files to save data, but the two loops that load vehicles for each family look fine.
the whole stock (LoadGangVehicles is to create the vehicles which loaded from the file)
Код:
stock LoadFamiliesHQ()
{
	if(!fexist(FAMILYHQPATH)) fcreate(FAMILYHQPATH);
	INI_Load(FAMILYHQPATH, .bLocal = false);
	
	for(new f = 0; f < MAX_FAMILY; f++)
	{
		LoadGangVehicles(f);
	}
	return 1;
}
Quote:
Originally Posted by Aerotactics
Посмотреть сообщение
I don't see an issue.

This is doing exactly as you said it was doing. For each family "f" it is loading 8 family vehicles "fv." If Spam is your issue, remove the printf message.
You don't see it wrong because it only 20/20k lines of serverlog.

Dude, i put printf to check if something go wrong there, because the family vehicles don't create properly due to vehicleids. (i look at my codes and all looks fine, for example: when i type /lock it says that isn't my family vehicle and before i switched to YINI it worked)
Reply
#5

Ok, I don't "speak" INI, but this is what my logic is telling me.
You're calling "LoadGangVehicles()" for every family. Then, inside this callback, you're somehow calling "INI:familieshq[FamilyCars](name[], value[])". The thing is "INI:familieshq[FamilyCars](name[], value[])" loops again through all the families, and this is what causes the problem.
Reply
#6

Quote:
Originally Posted by HazardouS
Посмотреть сообщение
Ok, I don't "speak" INI, but this is what my logic is telling me.
You're calling "LoadGangVehicles()" for every family. Then, inside this callback, you're somehow calling "INI:familieshq[FamilyCars](name[], value[])". The thing is "INI:familieshq[FamilyCars](name[], value[])" loops again through all the families, and this is what causes the problem.
I don't think LoadGangVehicles stock relate to the Loading file, LoadGangVehicles has a loop you right but its for each family, create vehicles by the values which loaded by the file before.

Код:
#define MAX_FAMILY 14
#define MAX_GANG_VEHICLES 8
As you can see that function sets up the vehicle parameters for each vehicle of each family.

Код:
stock LoadGangVehicles(f)
{
    for(new fv = 0; fv < MAX_GANG_VEHICLES; fv++)
	{
		if(FamilyVehicleInfo[f][fv][fvModelId] > 0)
		{
			new carcreated = AddStaticVehicleEx(FamilyVehicleInfo[f][fv][fvModelId], FamilyVehicleInfo[f][fv][fvSpawnX], FamilyVehicleInfo[f][fv][fvSpawnY], FamilyVehicleInfo[f][fv][fvSpawnZ], FamilyVehicleInfo[f][fv][fvSpawnA], FamilyVehicleInfo[f][fv][fvColor1], FamilyVehicleInfo[f][fv][fvColor2], -1);
			FamilyVehicleInfo[f][fv][fvId] = carcreated;
			SetVehicleHealth(carcreated, FamilyVehicleInfo[f][fv][fvCarHealth]);
			VehicleFuel[carcreated] = FamilyVehicleInfo[f][fv][fvFuel];
			VehicleBattery[carcreated] = FamilyVehicleInfo[f][fv][fvBattery];
			SetVehicleNumberPlate(carcreated, FamilyVehicleInfo[f][fv][fvNumberPlate]);
			UpdateVehicleDamageStatus(carcreated, FamilyVehicleInfo[f][fv][fvPanels], FamilyVehicleInfo[f][fv][fvDoors], FamilyVehicleInfo[f][fv][fvLights], FamilyVehicleInfo[f][fv][fvTires]);
			if(FamilyVehicleInfo[f][fv][fvLocked] == 1) LockGangVehicle(f, FamilyVehicleInfo[f][fv][fvId], FamilyVehicleInfo[f][fv][fvLock]);
		}
	}	
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)