Attaching object to vehicle.
#1

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

Bump
Reply
#3

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!
Reply
#4

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)