shop help
#1

piece of code:

Код:
if(GetPlayerMoney(playerid) >= 15000)//m4
				{
				    if(m4text[playerid] == 1)
					{
					    ShowMenuForPlayer(HIMenu,playerid);
						return SendClientMessage(playerid, WHITE, "you already bought this weapon...");
					}
					GivePlayerMoney(playerid, -15000);
					ShowMenuForPlayer(HIMenu,playerid);
					TogglePlayerControllable(playerid,0);
					m4text[playerid] = 1;
					ak74textspawn[playerid] = 0;
					if(ak74text[playerid] == 1)
					{
						ak74text[playerid] = 0;
					}
					if(mp5text[playerid] == 1)
					{
						mp5text[playerid] = 0;
					}
					if(shotguntext[playerid] == 1)
					{
						shotguntext[playerid] = 0;
					}
					format(Primary, sizeof(Primary), "M4A1");
    			}
It is going aboat: format(Primary, sizeof(Primary), "M4A1");

How can I make it that this format only counts for 1 player? The player who buyes the gun, because then it will show the textdraw with the current gun in it. Now everyone sees what he has bought, but not self has bought.
Reply
#2

You don't make the format for only one person, the format has nothing to do with players.

You need to make a textdraw for each person, and only update that players textdraw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)