17.12.2012, 01:12
Alright, I am using DracoBlue's DJson saving and reading system for saving car files as well as reading them. I have narrowed down a problem that prevents the car from being read in the file to the reading system itself. Here is what I have:
I am not very experienced with DJson; however on pre-existing gamemodes I tested out it seemed to be rather reliable! That being said and help will be appreciated and if you respond professionally and informatively you are likely to receive reputation
~Nmader
pawn Код:
stock InitVehicles()
{
new Vehicle[16];
for(new i = 0; i < MAX_VEHICLES; i++)
{
format(Vehicle, sizeof(Vehicle), "V_%d", i);
if(djIsSet(VEHICLES_FILE, Vehicle))
{
format(Vehicle, sizeof(Vehicle), "V_%d/PosX", i);
Vehicles[i][CarPosX] = djFloat(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/PosY", i);
Vehicles[i][CarPosY] = djFloat(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", i);
Vehicles[i][CarPosZ] = djFloat(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", i);
Vehicles[i][CarZAngle] = djFloat(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Model", i);
Vehicles[i][CarModel] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Col1", i);
Vehicles[i][CarColor1] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Col2", i);
Vehicles[i][CarColor2] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Military", i);
Vehicles[i][CarMilitary] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Fuel", i);
Vehicles[i][Fuel] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Rank", i);
Vehicles[i][CarRank] = djInt(VEHICLES_FILE, Vehicle, true);
if(Vehicles[i][CarModel] != 537 && Vehicles[i][CarModel] != 538 && Vehicles[i][CarModel] != 569 && 570 && Vehicles[i][CarModel] != 590)
{
Vehicles[i][GameID] = AddStaticVehicleEx(Vehicles[i][CarModel], Vehicles[i][CarPosX], Vehicles[i][CarPosY], Vehicles[i][CarPosZ], Vehicles[i][CarZAngle], Vehicles[i][CarColor1], Vehicles[i][CarColor2], 3600);
}
printf("[system] InitVehicles(): Vehicle %d has spawned (spawned from %s).", i, VEHICLES_FILE);
}
}
}
~Nmader