Object not attaching to vehicle
#1

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;
}
Reply
#2

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

Thanks
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)