Originally Posted by CAR
If you've got dini.inc, use this:
Top:
pawn Код:
new CarFile[50], Float:posx, Float:posy, Float:posz;
OnPlayerExitVehicle:
pawn Код:
format(CarFile, sizeof(CarFile), "vehicle%d.txt", vehicleid); if(!dini_Exists(CarFile)) dini_Create(CarFile); GetVehiclePos(vehicleid, posx, posy, posz); GetVehicleZAngle(vehicleid, posa); dini_FloatSet(CarFile, "x", posx); dini_FloatSet(CarFile, "y", posy); dini_FloatSet(CarFile, "z", posz); dini_FloatSet(CarFile, "a", posa);
OnVehicleSpawn:
pawn Код:
format(CarFile, sizeof(CarFile), "vehicle%d.txt", vehicleid); if(!dini_Exists(CarFile)) { dini_Create(CarFile); } else { posx = dini_Float(CarFile, "x"); posy = dini_Float(CarFile, "y"); posz = dini_Float(CarFile, "z"); posa = dini_Float(CarFile, "a"); SetVehiclePos(vehicleid, posx, posy, posz); SetVehicleZAngle(vehicleid, posa); }
I hope it works (it creates a file for any vehicle!)
|