View Single Post
Old 24/05/2013, 04:31 PM   #1
razor steven
Big Clucker
 
Join Date: Jun 2012
Posts: 71
Reputation: -4
Default Business problem- Zgaming roleplay...

Zgaming roleplay gamemode has dynamic business system with level system.

The problem is, Whatever the level of a business maybe, I can buy any item. Like Gascan is a level 5 item. Which means if the market doesn't have level 5, no one will be able to buy it. If the market have level 5, then it will be buyable.
But it is not working that way. Level 5 items can be bought from level 1 market...
How do I fix it?

Here's the code...

Code:
CMD:prices(playerid, params[])
{
	new idx = GetPlayerVirtualWorld(playerid)-100, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(idx > 0 && idx < MAX_BIZ && BizInfo[idx][bType] != 1 && BizInfo[idx][bType] != 2 && BizInfo[idx][bType] != 3 && BizInfo[idx][bType] != 4 && BizInfo[idx][bType] != 6 || idx < 1 || idx > MAX_BIZ) return SendClientMessage(playerid, COLOR_GREY, "You are not inside a business.");
    if(BizInfo[idx][bType] == 1)
	{
	    format(string, sizeof(string), "** %s's 24/7 Market menu list **", BizInfo[idx][bOwner]);
	    SendClientMessage(playerid, COLOR_ORANGE, string);
		if(BizInfo[idx][bLevel] >= 1) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 1: Cellphone ($100) | Phonebook ($50) | Dice ($20) | Cigar ($100)");
		if(BizInfo[idx][bLevel] >= 2) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 2: Speedometer ($200) | Sprunk ($30) | Spraycan ($100) | Rope ($60)");
		if(BizInfo[idx][bLevel] >= 3) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 3: Blindfold ($60) | WalkieTalkie ($200) | Smartphone($500)");
		if(BizInfo[idx][bLevel] >= 4) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 4: Camera ($300) | GasCan ($100)");
		//if(BizInfo[idx][bLevel] >= 5) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 5: Radio ($300)");
	}
	else if(BizInfo[idx][bType] == 3)
	{
	    format(string, sizeof(string), "** %s's Ammunation menu list **", BizInfo[idx][bOwner]);
	    SendClientMessage(playerid, COLOR_ORANGE, string);
		if(BizInfo[idx][bLevel] >= 1) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 1: 1) Shotgun Ammo ($400) | 2) Rifle Ammo ($2000)");
		if(BizInfo[idx][bLevel] >= 4) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 2: 3) Gun Ammo ($800)");
		if(BizInfo[idx][bLevel] >= 2) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 3: 4) Light-Machinegun Ammo ($1200)");
		if(BizInfo[idx][bLevel] >= 3) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 4: 5) Heavy-Machinegun Ammo ($2200)");
		if(BizInfo[idx][bLevel] >= 5) SendClientMessage(playerid, COLOR_WHITE, "UPGRADE 5: 6) Vest ($1000)");
	}
	else if(BizInfo[idx][bType] == 4)
	{
	    format(string, sizeof(string), "** %s's Club menu list **", BizInfo[idx][bOwner]);
	    SendClientMessage(playerid, COLOR_ORANGE, string);
		SendClientMessage(playerid, COLOR_WHITE, "1) Sprunk ($50) | 2) Beer ($100) | 3) Vodka ($200)");
	}
	else if(BizInfo[idx][bType] == 6)
	{
	    format(string, sizeof(string), "** %s's Fast Food menu list **", BizInfo[idx][bOwner]);
	    SendClientMessage(playerid, COLOR_ORANGE, string);
		SendClientMessage(playerid, COLOR_WHITE, "1) Small Meal ($10) | 2) Medium Meal ($30) | 3) Big Meal ($50)");
	}
	return 1;
}
__________________
United States Roleplay ~US:RP...

Awesome server with UNIQUE features.
Come and join US:RP today, Bet you're gonna love it.


212.227.143.24:8490

www.us-rp.com
razor steven is offline   Reply With Quote