How can i do that you cant buy if you dont have enough money ?
#1

Код:
	if(listitem == 0) //M4
	{
	SendClientMessage(playerid, COLOR_PURPLE, "* Sa ostsid M4");
	GivePlayerMoney(playerid,-30);
 	GivePlayerWeapon(playerid,31,500);
Problem is that if you even have $0 then you can buy and your money goes -30 example.
I want that if you dont have enough money you cant buy how can i do like that?
Reply
#2

pawn Код:
if(listitem == 0) //M4
    {
    if(GetPlayerMoney(playerid) >= 30)
    {
        SendClientMessage(playerid, COLOR_PURPLE, "* Sa ostsid M4");
        GivePlayerMoney(playerid,-30);
        GivePlayerWeapon(playerid,31,500);
    }
Reply
#3

Quote:
Originally Posted by hardstop
Код:
	if(listitem == 0) //M4
	{
	SendClientMessage(playerid, COLOR_PURPLE, "* Sa ostsid M4");
	GivePlayerMoney(playerid,-30);
 	GivePlayerWeapon(playerid,31,500);
Problem is that if you even have $0 then you can buy and your money goes -30 example.
I want that if you dont have enough money you cant buy how can i do like that?

Код:
if(listitem == 0) //M4
 {
 if(GetPlayerMoney(playerid) < 30)
 {	
  SendClientMessage(playerid, COLOR_PURPLE, "* Sa ostsid M4");
  GivePlayerMoney(playerid,-30);
  GivePlayerWeapon(playerid,31,500);
 }
Reply
#4

Thnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)