hm... i would do that like:
before spawning the car, its stored in a Variable, i assume. when the car spawns, remark its ID:
pawn Код:
new Car=CreateVehicle();//if you got 1900 cars on your map already, then this vehicle will get ID 1901 assigned. this 1901 will get stored in Car. like Car=1901;
after the vehicle spawned, and its ID is "written down" in Car, its time to set a PVar.which stores that vehicle id:
pawn Код:
SetPVarInt(playerid,"VehicleIDOwned",Car);
from now on you can use that
pawn Код:
GetPVarInt(playerid,"VehicleIDOwned")
when you destroy that vehicle now, you need to delete the pvar aswell, coz its referring to a not existing vehicle (or even worse, a wrong one).
pawn Код:
//despawnmycar
DestroyVehicle(GetPVarInt(playerid,"VehicleIDOwned");
DeletePVar(playerid,"VehicleIDOwned");
..if this all aucceds and works like mentioned, its easy to enhance the whole script to work like that. its a good idea to search for "vehicle" in the entire script, and look if some changes are required.
edit: just noticed: when you /despawnmycar, then the car will be lost. you need to ad one more variable which tells the vehicle model id, so you can spawn it again...