How to make a gun charge you instead of getting it for free?
#1

Hey Sa-mp.com, I need help with setting the gun prices of each item for an example this is one menu item.

Код:
AddMenuItem(weapon4, 0, "Shotgun");
How would I make it cost to buy a Shotgun instead of getting it for free?

Reply
#2

Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
  new Menu:current;
  new WeaponID;
  new WeaponCost;

//-----------------Change These-------------------
WeaponCost = ;
WeaponID = ;
//--------------------------------------------------


  current = GetPlayerMenu(playerid);
  if(current == weapon4)
  {
    switch(row)
    {
      case 0:
      {
			if (GetPlayerMoney(playerid) >= WeaponCost)
			{
				GivePlayerMoney(playerid, -WeaponCost); //Use a negative number to subtract
				GivePlayerWeapon(playerid, WeaponID, 500);
			}
      }
    }
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)