SA-MP Forums Archive
How to attach money bag - 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: How to attach money bag (/showthread.php?tid=538604)



How to attach money bag - GunZ75 - 22.09.2014

Hi guys i would like to know the script to attach a money bag to the back of a person. I cant make it myself cause i started scripting some days ago. And ik skins have different cordinates but just put one that stays nice in every skin.

If u can make that for me i would apreciate alot


Re: How to attach money bag - killing - 22.09.2014

Code:
Moneybag = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToPlayer(Moneybag, playerid, -0.300999,0.337999,-0.093999, 0.000000,-90.400001,166.100006);
Code:
new Moneybag; //add this any where in ur script



Re: How to attach money bag - Ghazal - 22.09.2014

Quote:
Originally Posted by killing
View Post
Code:
Moneybag = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToPlayer(Moneybag, playerid, -0.300999,0.337999,-0.093999, 0.000000,-90.400001,166.100006);
Code:
new Moneybag; //add this any where in ur script
If he used new Moneybag without [MAX_PLAYERS]; when he remove the object, it will remove for all of the players

I will suggest the following code since you can remove it for a specified player.

pawn Code:
new     MoneyBag[MAX_PLAYERS];

        AttachObjectToPlayer( MoneyBag[playerid], playerid, -0.027000, -0.251999, 0.000000 , 1.000000, 1.000000, 1.000000 );