09.12.2010, 04:04
[QUOTE=Kyle_Olsen;946302]Okey, this is my vehicle initation process...
the indentation got messed up so tidy it up before you use it.
See what i added at the bottom of the script, if it prints that in the console, then you know its djIsSet
Why did you remove the MAX_VEHICLES define? just use it for simplicity.
PS: djInt is for integers. You should change that.
pawn Код:
stock InitVehicles()
{
print("Initiating vehicle initiation process");
new Vehicle[16];
for(new i = 0; i < 500; 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/Owner", i);
Vehicles[i][Owner] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Plate", i);
Vehicles[i][Plate] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Col1", i);
Vehicles[i][CarColour1] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Col2", i);
Vehicles[i][CarColour2] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Group", i);
Vehicles[i][CarGroup] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Locked", i);
Vehicles[i][Locked] = djInt(VEHICLES_FILE, Vehicle, true);
format(Vehicle, sizeof(Vehicle), "V_%d/Alarm", i);
Vehicles[i][Alarm] = djInt(VEHICLES_FILE, Vehicle, true);
CarCount++;
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][CarColour1], Vehicles[i][CarColour2], 3600 );
SetVehicleNumberPlate(i, Vehicles[i][Plate]);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(i,engine,lights,Vehicles[i][Alarm],Vehicles[i][Locked],bonnet,boot,objective);
}
printf( "[system] InitVehicles(): Vehicle %d has spawned (spawned from %s).", i, VEHICLES_FILE);
}
else
{
print("Cars Not Found!")
}
}
}
See what i added at the bottom of the script, if it prints that in the console, then you know its djIsSet
Why did you remove the MAX_VEHICLES define? just use it for simplicity.
PS: djInt is for integers. You should change that.