SA-MP Forums Archive
How can i do that you cant buy if you dont have enough money ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can i do that you cant buy if you dont have enough money ? (/showthread.php?tid=132228)



How can i do that you cant buy if you dont have enough money ? - hardstop - 06.03.2010

Код:
	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?


Re: How can i do that you cant buy if you dont have enough money ? - pen_theGun - 06.03.2010

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



Re: How can i do that you cant buy if you dont have enough money ? - Peep - 06.03.2010

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);
 }



Re: How can i do that you cant buy if you dont have enough money ? - hardstop - 06.03.2010

Thnx