Attaching object 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: Attaching object to vehicle. (
/showthread.php?tid=564961)
Attaching object to vehicle. -
fonia5 - 24.02.2015
I can't understand it on the SAMP wiki at all. i do it and it won't work can somebody at least tell me
Код:
CMD:loadtruck(playerid, params[])
{
new objectid = CreateObject(3800, 2163.38525, -2283.33569, 6.33094, 0.00000, 0.00000, -44.03999);
new vehicleid = GetPlayerVehicleID(playerid);
AttachObjectToVehicle(objectid, vehicleid, 3800, 578, 1.0, 0.0, 0.0, 0.0);
}
Example how i want it.
Photo
Then when that object is attached i want it so you have to go back and load more objects on to the truck example 10 objects. but i can't get my head around attaching it.
Re: Attaching object to vehicle. -
fonia5 - 24.02.2015
Bump
Re: Attaching object to vehicle. -
Qu3esL - 24.02.2015
That code will work, it will simply attach the object to the player's vehicle at thи spкcifiлd pos.
I dont understand your last sentence!
Re: Attaching object to vehicle. -
fonia5 - 24.02.2015
Quote:
Originally Posted by Qu3esL
That code will work, it will simply attach the object to the player's vehicle at thи spкcifiлd pos.
I dont understand your last sentence!
|
it dont work it creates the object but dose not attach.
Re: Attaching object to vehicle. -
Gammix - 24.02.2015
Read the wiki:
http://forum.sa-mp.com/wiki/AttachObjectToVehicle
Which explains that Offsets are axis of object to be attached from the vehicle and not from the ground or space.
I remember when i was a newbie, i use to do that with global obects in the map editor and not even attaching them. Just placing initially from space.
Your Offset values are incredibly high! That will attach but land up at a large distance from vehicle(maybe in the sky, 3800units away!)
I suggest you to use this filterscript:
https://sampforum.blast.hk/showthread.php?tid=282883