SA-MP Forums Archive
Shop problem - 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: Shop problem (/showthread.php?tid=507088)



Shop problem - Ananisiki - 15.04.2014

When a player type /shop the other one gets the textdraw too and they cant be destroyed after that when clicking mmb, why ?


pawn Code:
CMD:shop(playerid, params[])
{
    #pragma unused params
    if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            RemoveAllTextDraws(playerid);
            TextDrawShowForPlayer(i, ShopTD0[playerid]);
            TextDrawShowForPlayer(i, ShopTD1[playerid]);
            TextDrawShowForPlayer(i, ShopTD2[playerid]);
            TextDrawShowForPlayer(i, ShopTD3[playerid]);
            TextDrawShowForPlayer(i, ShopTD4[playerid]);
            TextDrawShowForPlayer(i, ShopTD5[playerid]);
            TextDrawShowForPlayer(i, ShopTD6[playerid]);
            TextDrawShowForPlayer(i, ShopTD7[playerid]);
        }
    }
    Shop[playerid] = 1;
    return 1;
}



Re: Shop problem - Bingo - 15.04.2014

You are doing this for all players buddy, You used max players why?


Re: Shop problem - Ananisiki - 15.04.2014

I created it long time ago but i was myself, now i got players and noticed


Re: Shop problem - Bingo - 15.04.2014

Remove this:-
pawn Code:
for(new i; i < MAX_PLAYERS; i ++)
Change this:-
pawn Code:
if(IsPlayerConnected(playerid))
        {
Change this
pawn Code:
TextDrawShowForPlayer(i, ShopTD0[playerid]);
To this
pawn Code:
TextDrawShowForPlayer(playerid, ShopTD0);
TextDrawShowForPlayer(playerid, ShopTD1);
TextDrawShowForPlayer(playerid, ShopTD2);
Goes on.... For all shoptd's

Same for all okay?


Re: Shop problem - Ananisiki - 15.04.2014

Thanks man +rep


Re: Shop problem - Bingo - 15.04.2014

Quote:
Originally Posted by Ananisiki
View Post
Thanks man +rep
Thank you.

If any glitches still, Hit me up with PM .