Need help with Money script.
#1

Ok so i made a script that it costs you 1000$ to buy an mp5. I want to make an "if" that checks if you have 0$ will say you don't have money and if you have < 1000 you don't have enough. Please help .

Код:
	if (strcmp("/mp5", cmdtext, true, 10) == 0)
	{
		GivePlayerMoney(playerid, -1000);
		GivePlayerWeapon(playerid, 29, 500);
		SendClientMessage(playerid, COLOR_YELLOW, "You have received a MP5.");
		return 1;
	}
Reply
#2

posting in few mins wait...
Reply
#3

Код:
	if (strcmp("/mp5", cmdtext, true, 10) == 0)
	{
		if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,0xFF0000AA, "You don't have enough money!You Need 1,000!");
		SendClientMessage(playerid, COLOR_YELLOW, "You have received a MP5.");
		GivePlayerWeapon(playerid, 29, 500);
		GivePlayerMoney(playerid, -1000);
		return 1;
	}
ok?
Reply
#4

Код:
if(GetPlayerMoney(playerid) >=Money)
It will help you
Reply
#5

Thank you! It's perfect
Reply
#6

its ok like that too...
np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)