GetPlayerMoney
#1

Hey.
Код:
			if (GetPlayerMoney(playerid) > {Amount?} )
				{
	      	if(strcmp(gunid, "stretch", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A Stretch");
						HouseInfo[house][hVec] = 409;
						GivePlayerMoney(playerid,-50000);
					}
					else if(strcmp(gunid, "zr350", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A ZR-350");
						HouseInfo[house][hVec] = 477;
						GivePlayerMoney(playerid,-100000);
					}
					else if(strcmp(gunid, "stallion", true, strlen(gunid)) == 0)
					{
						SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A Stallion");
						HouseInfo[house][hVec] = 439;
						GivePlayerMoney(playerid,-150000);
					}
                   else
				{
					SendClientMessage(playerid, COLOR_RED, "  You can't afford that {Amount?} ");
					return 1;
				}
			}
How would I make it so, for every different price, if you don't have the correct amount of money you can't buy it?
Thanks in advance and I respect if you don't want to help, because of it being within the GodFather, but it will help for other scripts.
Reply
#2

Код:
if(strcmp(gunid, "stretch", true, strlen(gunid)) == 0)
{
	if (GetPlayerMoney(playerid) >= 50000)
	{
		SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A Stretch");
		HouseInfo[house][hVec] = 409;
		GivePlayerMoney(playerid,-50000);
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "You can't afford that!");
	}
	return 1;
}
Do it with all cars, I think.
Reply
#3

Works a treat! Thank you very much =]
Much appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)