attaching object
#1

Ok im trying to create my own cash bag system where when the player finds it they press LALT key and it should be attacted to there back and a checkpoint should be created and they should deliver the money bag to the check point in order to receive the reward cash. All that works great but the only problem i have is the money bag is not been showed on the players back(it doesnt appear at all) but if the player enter the checkpoint they will still recieve the reward cash, even without having the moneybag on his/here back.

I didnt get the coords by my self i saw it in a post on this forums so im wondering if its the skin coordinates that are wrong but if it was, the money bag would atleast show some where around the player, right?

pawn Код:
if(newkeys & KEY_WALK)
    {
        DestroyPickup(CashBagPickup);
        AttachObjectToPlayer(1550, playerid, -0.300999,0.337999,-0.093999, 0.000000,-90.400001,166.100006);
        SendClientMessage(playerid,-1,"Deliver the moneybag to the checkpoint to recieve cash.");
Well i think thats all you will need but if need anymore code i will gladly post it ....
Reply
#2

Use SetPlayerAttachedObject
PHP код:
SetPlayerAttachedObject(playerid515501, -0.300999,0.337999,-0.0939990.000000,-90.400001,166.100006); 
Reply
#3

ok now the object attachs to the player but the bag it set wrong and its at the front of the player not the back, can you tell me how to get the coords and another thing i trying to fix a bug where if you are not near the money bag you cant pick it up but it doesnt work it only give me the warning that i am not near the money bag even when im standing right on it

pawn Код:
if(newkeys & KEY_WALK)
    {
        if(IsPlayerNearObject(playerid, CashBagPickup,CashBagLocation))
        {
            DestroyPickup(CashBagPickup);
            SetPlayerAttachedObject(playerid, 0, 1550, 1, -0.300999,0.337999,-0.093999, 0.000000,-90.400001,166.100006);
            SendClientMessage(playerid,-1,"Deliver the cash bag to the checkpoint to recieve cash.");
Reply
#4

Use attach object editor : https://sampforum.blast.hk/showthread.php?tid=416138
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)