07.12.2010, 13:46
Okey, this is my vehicle initation process...
It doesn't give any errors or warnings, but it seems that if(djIsSet(VEHICLES_FILE, Vehicle) ) is blocking it... My problem is that the cars don't spawn. I've checked my file, and I'm sure they are all set. Here is something out of my file for you to see
So what is wrong here? Is it a bug maybe?
Код:
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); } } }
Код:
"V_1":{"Col1":-1,"Col2":-1,"Group":1,"Model":596,"Plate":LSGV-DMV,"Locked":0,"Alarm":0,"Owner":0,"PosX":1545.589233,"PosY":-1680.213623,"PosZ":5.612060,"ZAngle":91.456855}