10.07.2012, 09:07
Well.. Yeah - I've been working on a new Dealership system.. It should Load the Car from the folder "Cars" once OnGameModeInIt is Called.. So here :
The problem that once I Put
under OnGameModeInIt - The Console starts the server without Loading ANYTHING under LoadCars - It doesn't load the objects or anything under it.. It loads all of the things above only
So.. What's the problem ?
PHP код:
stock LoadCars()
{
new FileName[128];
new carstring[256];
for(new i = 0; i < MAX_CARS; i++)
{
format(FileName, sizeof(FileName), "Cars/car_%d.ini", i);
if(fexist(FileName))
{
CarInfo[i][CarModel] = dini_Int(FileName, "CarModel");
CarInfo[i][CarPrice] = dini_Int(FileName, "CarPrice");
CarInfo[i][CarX] = dini_Float(FileName, "CarX");
CarInfo[i][CarY] = dini_Float(FileName, "CarY");
CarInfo[i][CarZ] = dini_Float(FileName, "CarZ");
CarInfo[i][CarF] = dini_Float(FileName, "CarF");
CarInfo[i][CarSpawnX] = dini_Float(FileName, "CarSpawnX");
CarInfo[i][CarSpawnY] = dini_Float(FileName, "CarSpawnY");
CarInfo[i][CarSpawnZ] = dini_Float(FileName, "CarSpawnZ");
CarInfo[i][CarSpawnF] = dini_Float(FileName, "CarSpawnF");
CarInfo[i][CarColor] = dini_Int(FileName, "CarColor");
CarInfo[i][CarColor] = dini_Int(FileName, "CarColor2");
if(i == 1)
{
format(carstring,sizeof(carstring),"%s For Sale | {FFF1AF}Price: $%d | {6EF83C}ID: %d",vehName[CarInfo[i][CarModel]-400],CarInfo[i][CarPrice],i);
CarInfo[i][CarText] = Create3DTextLabel(carstring, COLOR_CAR, 0.0, 0.0, 0.0, 15.0, 0);
CarInfo[i][CarID] = AddStaticVehicleEx(CarInfo[i][CarModel],CarInfo[i][CarX],CarInfo[i][CarY],CarInfo[i][CarZ],CarInfo[i][CarF],CarInfo[i][CarColor],CarInfo[i][CarColor2],1);
Attach3DTextLabelToVehicle(CarInfo[i][CarText], CarInfo[i][CarID], 0.0, 0.0, 0.0);
// SetVehicleVirtualWorld(i,255);
CarInfo[i][DealerShipCar] = 1;
}
else
{
format(carstring,sizeof(carstring),"%s For Sale | {FFF1AF}Price: $%d | {6EF83C}ID: %d",vehName[CarInfo[i][CarModel]-400],CarInfo[i][CarPrice],i);
CarInfo[i][CarText] = Create3DTextLabel(carstring, COLOR_CAR, 0.0, 0.0, 0.0, 15.0, 0);
CarInfo[i][CarID] = AddStaticVehicleEx(CarInfo[i][CarModel],CarInfo[i][CarX],CarInfo[i][CarY],CarInfo[i][CarZ],CarInfo[i][CarF],CarInfo[i][CarColor],CarInfo[i][CarColor2],1); // Blade ID 56
Attach3DTextLabelToVehicle(CarInfo[i][CarText], CarInfo[i][CarID], 0.0, 0.0, 0.0);
CarInfo[i][DealerShipCar] = 1;
}
SpawnedCars++;
}
}
return 1;
}
PHP код:
LoadCars();
So.. What's the problem ?