SA-MP Forums Archive
Attatch Object to player - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Attatch Object to player (/showthread.php?tid=76924)



Attatch Object to player - NeRoSiS - 07.05.2009

Okay, i'v seen somewhere the object of a gun on someones back, which is obviously attatchobjecttoplayer, but i'm wondering, how do you get the co-ordinates? There's no equivalent of MTA or breadfish etc for attatching objects, so how would I go about attatching a katana object to someones back?


Re: Attatch Object to player - Weirdosport - 07.05.2009

Predominantly through trial and error. AttachObjectToPlayer gets the players position at a given time, and offsets the object in the way you want it to. So to get the object behind the player you'd need to set some negative y value, and maybe a bit of positive z value. As you want the gun to be central you probably don't need to mess with the x value. As for the rotation It'd be a case of trial and error.


Re: Attatch Object to player - NeRoSiS - 07.05.2009

so the player is the axis and not the map?


Re: Attatch Object to player - Weirdosport - 07.05.2009

With that thingy yes, Y is infront/behind, x is left/right and z is up/down (I think, X and Y might be flipped)