SA-MP Forums Archive
Attach Moneybag - 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: Attach Moneybag (/showthread.php?tid=511651)



Attach Moneybag - vassilis - 06.05.2014

solved


Re: Attach Moneybag - awsomedude - 06.05.2014

Try this:

pawn Код:
new Moneybag;

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);//<<==============



Re: Attach Moneybag - DiGiTaL_AnGeL - 06.05.2014

pawn Код:
new yourobject;
CMD:robstore(playerid,params[])
{
    if(gteam[playerid] != TEAM_CIV) return SendClientMessage(playerid,COLOR_RED,"(Error): You must be civilian to use this command!");
    if(!IsPlayerNearAnyRobberyArea(playerid)) return ErrorMessages(playerid,5);
    if(GetPlayerWantedLevel(playerid) >= 3) return ErrorMessages(playerid,7);
    if(alreadyrobbed[playerid] && gettime() < alreadyrobbed[playerid])return SendClientMessage(playerid,COLOR_RED,"(Error): You have already robbed a shop!Try Later!");
    if(Player_CountDown[playerid] != -1) return SendClientMessage(playerid, COLOR_RED, "(Error): Please wait until the robbery you've started gets finished.");
    Player_CountDown[playerid] = 30;
    yourobject = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); //<<======================
    AttachObjectToPlayer(yourobject, playerid, -0.300999,0.337999,-0.093999, 0.000000,-90.400001,166.100006);//<<==============
    PlayerTimer_CountDown[playerid] = SetTimerEx("countdown", 1000, true, "i", playerid);
    SetPlayerProgressBarValue(playerid,bar[playerid],0);
    ShowPlayerProgressBar(playerid,bar[playerid]);
    IncreasePlayerWantedLevel(playerid,4);
    alreadyrobbed[playerid] = gettime() + 120;
    SendClientMessage(playerid,-1," ("COL_GREEN"WAIT"COL_WHITE"): Please stay at the point for 30 seconds if you want the robbery to be completed!");
    GameTextForPlayer(playerid,"~r~Starting Robbery!",1000,6);
    return 1;
}
This should work.

P.S. Late post, sorry.


Re: Attach Moneybag - vassilis - 06.05.2014

ye i thought that but i am thinking if i need to use an array or no


Re: Attach Moneybag - vassilis - 07.05.2014

so ??


Re: Attach Moneybag - davve95 - 07.05.2014

I lend the topic a bit, I have a similar question.

How should I know the coordinates if I want to attach a object to a player?.

I mean at a specific place on the player not that the player chose with "Toy editor" I mean without it.