PDA

View Full Version : Shop problem


Ananisiki
15/04/2014, 11:14 PM
When a player type /shop the other one gets the textdraw too and they cant be destroyed after that when clicking mmb, why ?



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;
}

Bingo
15/04/2014, 11:29 PM
You are doing this for all players buddy, You used max players why?

Ananisiki
15/04/2014, 11:30 PM
I created it long time ago but i was myself, now i got players and noticed

Bingo
15/04/2014, 11:37 PM
Remove this:-
for(new i; i < MAX_PLAYERS; i ++)

Change this:-
if(IsPlayerConnected(playerid))
{

Change this
TextDrawShowForPlayer(i, ShopTD0[playerid]);

To this
TextDrawShowForPlayer(playerid, ShopTD0);
TextDrawShowForPlayer(playerid, ShopTD1);
TextDrawShowForPlayer(playerid, ShopTD2);

Goes on.... For all shoptd's

Same for all okay?

Ananisiki
15/04/2014, 11:42 PM
Thanks man +rep

Bingo
15/04/2014, 11:43 PM
Thanks man +rep

Thank you.

If any glitches still, Hit me up with PM :D.