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);
}
}
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;
}
|
the show is in the shop (at player spawn).... |