SA-MP Forums Archive
Object not attaching to vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Object not attaching to vehicle (/showthread.php?tid=347620)



Object not attaching to vehicle - aqu - 02.06.2012

I don't undesrstand,why it's not attaching?

Код:
public OnVehicleSpawn(vehicleid)
{
 if(vehicleid == 487){
  VehicleHasObject[vehicleid] = true;
  VehicleAttachedObject[vehicleid] = CreateObject(1473, 1.754998, 0.414999, -0.969999, -27.134992, 0.000000, 0.000000, 100.0);
  AttachObjectToVehicle(VehicleAttachedObject[vehicleid], vehicleid, 1.754998, 0.414999, -0.969999, -27.134992, 0.000000, 0.000000);
 }
 return 1;
}

public OnVehicleDeath(vehicleid)
{
 if(VehicleHasObject[vehicleid]){
  DestroyObject(VehicleAttachedObject[vehicleid]);
  VehicleHasObject[vehicleid] = false;
 }
 return 1;
}



Re: Object not attaching to vehicle - Yuryfury - 02.06.2012

You need to use GetVehicleModel(vehicleid) and compare that to 487.


Re: Object not attaching to vehicle - aqu - 02.06.2012

Thanks


Re: Object not attaching to vehicle - aqu - 02.06.2012

But in-game there are no object attached to maveric yet.Where's the problem?
EDIT: oh I noticed that it attaches only when vehicle respawn.