SA-MP Forums Archive
Problem AttachObjectToVehicle - 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: Problem AttachObjectToVehicle (/showthread.php?tid=346453)



Problem AttachObjectToVehicle - diablo16 - 28.05.2012

Hi I have a problem with AttachObjectToVehicle :



Please tell me the coordonates for the siren to be on top of the car(center).


Re: Problem AttachObjectToVehicle - SuperViper - 28.05.2012

Do it like this and replace the object ID:

pawn Код:
new Float: vSize[3], vehicleid = GetPlayerVehicleID(playerid);
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, vSize[0], vSize[1], vSize[2]);
AttachObjectToVehicle(objectid, vehicleid, 0.0, 0.0, vSize[2] - 0.75, 0.0, 0.0, 0.0);