SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[GameMode] zGaming Roleplay iRage Gamemode Scripts 1004 25/12/2017 04:26 PM


All times are GMT. The time now is 09:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.