16.01.2014, 17:03
Hello, I've tried to make it so when my game mode loads up, the vehicles load up with it that have been made in game.
I've debugged it, it loads it up but doesn't create the vehicle. Can someone help me, Thank you for in advance.
pawn Код:
stock LoadCars()
{
new vinfo[12][32];
new string[256];
new File:file = fopen("cars.cfg", io_read);
if(file)
{
new idx = 1;
while(idx < MAX_CARS)
{
fread(file, string);
splits(string, vinfo, '|');
VehicleInfo[idx][vModel] = strval(vinfo[0]);
VehicleInfo[idx][vX] = floatstr(vinfo[1]);
VehicleInfo[idx][vY] = floatstr(vinfo[2]);
VehicleInfo[idx][vZ] = floatstr(vinfo[3]);
VehicleInfo[idx][vAngle] = floatstr(vinfo[4]);
VehicleInfo[idx][vColor1] = strval(vinfo[5]);
VehicleInfo[idx][vColor2] = strval(vinfo[6]);
CreateVehicle(strval(vinfo[0]), floatstr(vinfo[1]), floatstr(vinfo[2]), floatstr(vinfo[3]), floatstr(vinfo[4]), strval(vinfo[5]), strval(vinfo[6]), -1);
//CreateVehicle(VehicleInfo[idx][vModel], VehicleInfo[idx][vX], VehicleInfo[idx][vY], VehicleInfo[idx][vZ], VehicleInfo[idx][vAngle], VehicleInfo[idx][vColor1], VehicleInfo[idx][vColor2], -1);
//CreateVehicle(Vehiclenfop, Float:vX, Float:vY, Float:vZ, Float:vAngle, vColor1, vColor2, -1);
//print("Loaded?");
idx++;
}
}
//idx++;
print("Universal Gaming: Vehicles are susscefully loaded!");
return 1;
}