15.01.2011, 21:38
So here is my main question: Why does it shows the changed (formatted) textdraw for everyone, but why not only for the player who has bought the weapon? How can I fix this?
the show is in the shop (at player spawn)....
changing public updateweapon() to public updateweapon(playerid) didn't helped either..
Any ideas to fix this? Is there some kind of TextDrawSetStringForPlayer ?? It is for my shop..
Code:
public OnPlayerSelectedMenuRow(playerid, row)//shop { TogglePlayerControllable(playerid,1); new Menu: Current = GetPlayerMenu(playerid); ShowMenuForPlayer(HIMenu,playerid); if(Current == HIMenu) { SetPlayerInterior(playerid,6); switch(row) { case 0: { 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; } SetPVarString(playerid,"currentprimary","M4A1"); } else { SendClientMessage(playerid, WHITE, "You don't have enough money."); ShowMenuForPlayer(HIMenu,playerid); TogglePlayerControllable(playerid,0); } }
Code:
public updateweapon() { for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { GetPVarString(playerid, "currentprimary", Primary, 25); GetPVarString(playerid, "currentsecondary", Secondary, 25); GetPVarString(playerid, "currentextra", Extra, 25); TextDrawSetString(primary,Primary); TextDrawSetString(secondary,Secondary); TextDrawSetString(extra,Extra); } return 1; }
changing public updateweapon() to public updateweapon(playerid) didn't helped either..
Any ideas to fix this? Is there some kind of TextDrawSetStringForPlayer ?? It is for my shop..