01.02.2018, 20:19
u can create at anywhere where u want (for examples at CMD)
define object at top of the script
new VehObject[MAX_VEHICLES];
put this script at command
vehid = GetPlayerVehicleID(playerid);
VehObject[vehid] = CreateObject(objectid,0,0,0,0,0,0,0);
AttachObjectToVehicle(VehObject[vehid],vehid,0,0,0,0,0,0);
and put this at OnVehicleDestroy
DestroyObject(VehObject[vehicleid]);
u can also check these functions at wiki to get full information how to use it.
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle
define object at top of the script
new VehObject[MAX_VEHICLES];
put this script at command
vehid = GetPlayerVehicleID(playerid);
VehObject[vehid] = CreateObject(objectid,0,0,0,0,0,0,0);
AttachObjectToVehicle(VehObject[vehid],vehid,0,0,0,0,0,0);
and put this at OnVehicleDestroy
DestroyObject(VehObject[vehicleid]);
u can also check these functions at wiki to get full information how to use it.
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle