06.01.2013, 23:59
(
Последний раз редактировалось zDevon; 07.01.2013 в 00:53.
)
Well since I couldn't get any help here https://sampforum.blast.hk/showthread.php?tid=404159 I'm still trying to fix it on my own. No relief yet but I was hoping I could get some assistance on a different simple aspect of it.
'VehID' is the mysql id. With that code I'm trying to set vid equal to vehid, and then check if it exists. If it does, set vehicleid's position accordingly. Except, if the samp vehicle id and the mysql id don't match, the position is not set. If they're the same then everything works properly, but you can see how obvious of a problem that creates. Any ideas?
pawn Код:
public OnVehicleSpawn(vehicleid)
{
new vid = VehicleInfo[vehicleid][vVehID];
new query[100];
format(query,sizeof(query),"SELECT * FROM vehicles WHERE VehicleID = '%i'",vid);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() != 0) {
printf("Spawning vehicle %i (sampid %i)",vid,vehicleid);
SetVehiclePos(vid,VehicleInfo[vid][vVehParkX],VehicleInfo[vid][vVehParkY],VehicleInfo[vid][vVehParkZ]);
SetVehicleZAngle(vid,VehicleInfo[vid][vVehParkA]);
}
mysql_free_result();
return 1;
}