Shop problem
#1

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;
}
Reply
#2

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

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

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?
Reply
#5

Thanks man +rep
Reply
#6

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

If any glitches still, Hit me up with PM .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)