14.05.2011, 16:07
As you see here, I create a new vehicle. Before it, there is 'new vehicle = ' so I can store the vehicle ID for a while. If I use this, the server will stop after it (the last thing it prints is "Debug 3", while that gets called AFTER it). If I remove that 'new vehicleid = ' it just works fine. So I guess this is bugged, for everything where vehicleid is used after it, cause the server stops at VehicleInfo[vehicleid][FileVehicleID] = v;
According to this topic, where we couldn't find a solution.
According to this topic, where we couldn't find a solution.
pawn Код:
for(new v = 0; v < MAX_VEHICLES; v ++)
{
new QueryString[128],Line[128],ID,modelid,VehicleColor,Own[MAX_PLAYER_NAME],vehicleid,Float:VehicleAngle,doors,panels,lights,tires,Float:Health,Float:VehiclePos[3],Fuel2,ParkedLot2,PhoneBooks2,Ropes2,BlindFolds2,MedicalKits2;
VehicleInfo[v][Fuel] = 100;
format(QueryString,sizeof(QueryString),"SELECT * FROM `VehicleInfo` WHERE `ID` = '%d'",v);
mysql_query(QueryString);
mysql_store_result();
if(mysql_num_rows())
{
if(mysql_fetch_row(Line))
{
print("Debug 1");
sscanf(Line,"p<|>dds[24]ffffdddddfddddd",ID,modelid,VehicleColor,Own,VehiclePos[0],VehiclePos[1],VehiclePos[2],VehicleAngle,Fuel2,doors,panels,lights,tires,Health,ParkedLot2,PhoneBooks2,Ropes2,BlindFolds2,MedicalKits2);
print("Debug 2");
vehicleid = CreateVehicle(modelid,VehiclePos[0],VehiclePos[1],VehiclePos[2],VehicleAngle,VehicleColor,VehicleColor,-1);
print("Debug 3");
VehicleInfo[vehicleid][FileVehicleID] = v;
print("Debug 4");
VehicleInfo[vehicleid][Owned] = 1;
print("Debug 5");
VehicleInfo[vehicleid][Fuel] = Fuel2;
print("Debug 6");
VehicleInfo[vehicleid][ParkedLot] = ParkedLot2;
print("Debug 7");
VehicleInfo[vehicleid][ContainingPhonebooks] = PhoneBooks2;
print("Debug 8");
VehicleInfo[vehicleid][ContainingRopes] = Ropes2;
print("Debug 9");
VehicleInfo[vehicleid][ContainingBlindfolds] = BlindFolds2;
print("Debug 10");
VehicleInfo[vehicleid][ContainingMedicalKits] = MedicalKits2;
print("Debug 11");
format(VehicleInfo[vehicleid][Owner],MAX_PLAYER_NAME,"%s",Own);
print("Debug 12");
SetVehicleHealth(vehicleid,Health);
print("Debug 13");
OnVehicleDamageStatusUpdate(vehicleid,-1);
print("Debug 14");
UpdateVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
printf("Owner File Vehicle ID '%d' (vehicleid '%d') has been created at X:%.3f || Y:%.3f || Z:%.3f",v,vehicleid,VehiclePos[0],VehiclePos[1],VehiclePos[2]);
}
}
}