SA-MP Forums Archive
[FilterScript] Bug SetPlayerHoldingObject! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Bug SetPlayerHoldingObject! (/showthread.php?tid=437801)



Bug SetPlayerHoldingObject! - Dister_Robi - 17.05.2013

After i use SetPlayerHoldingObject and it attached to me,
after i wait 1 second, the object was destroyed(i can't see that)
Help me!


Re: Bug SetPlayerHoldingObject! - SupremeCommander - 17.05.2013

nice work rep+

lol jk wrong section. next time, post it here.

http://forum.sa-mp.com/forumdisplay.php?f=12

anyways, can you please show us the code?


Re: Bug SetPlayerHoldingObject! - Dister_Robi - 17.05.2013

Code

pawn Код:
if(!strcmp("/glass",cmd,true))
    {
        if(PlayerInfo[playerid][pSunglass] != 0)
        {
            tmp = strtok(cmdtext, idx);
            skin = GetPlayerSkin(playerid);
            id = strval(tmp);

            if(!id || id > 33) return SendClientMessage(playerid, COLOR_ORANGE, "/glass [1 - 33] ");
            {
                    if(id > 30) goto PutPoliceGlasses;
                    else
                    {
                        id--;
                        glasseid =  CommonRed + id;
                        SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
                        return 1;
                    }

                    PutPoliceGlasses:

                    glasseid = CopGlassesBlack + (id - 31);
                    SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], floatadd(SkinOffSet[skin][1], 0.004500), SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
                    return 1;
            }
        }
        else
        {
        SendClientMessage(playerid, COLOR_ORANGE, "Buy in 24/7");
        return 1;
        }
    }