SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/11/2012, 10:28 PM   #1
SafewayLol
Little Clucker
 
Join Date: Nov 2012
Posts: 10
Reputation: 0
Default Businesses

So im editing zGaming RP script and it has:

Businesses: Fully functioning dynamic businesses (24/7 Market - Clothes Shop - Ammunation - Advertisement Agency - Club - Fast Food).

Dynamic businesses means its empty or something?
I added in the icons to enter the buildings etc that leads to correct interiors but when i do /buybiz it says "you are not near a buyable business" even though when i go on the icon it says "Business - type /enter to enter"

If that makes sence?

Basically how can i make it a buyable business?

If you need any more info just leave a reply, Thanks
SafewayLol is offline   Reply With Quote
Old 09/11/2012, 10:29 PM   #2
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,308
Reputation: 167
Default Re: Businesses

U shall post this on zGaming script thread...
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 09/11/2012, 10:31 PM   #3
SafewayLol
Little Clucker
 
Join Date: Nov 2012
Posts: 10
Reputation: 0
Default Re: Businesses

But this section is also for Scripting help, Which is what im in need of. Im also really new to scripting but i did add a few things myself
SafewayLol is offline   Reply With Quote
Old 09/11/2012, 10:46 PM   #4
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,308
Reputation: 167
Default Re: Businesses

Then we need the code so we can help you.
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 09/11/2012, 10:52 PM   #5
SafewayLol
Little Clucker
 
Join Date: Nov 2012
Posts: 10
Reputation: 0
Default Re: Businesses

Quote:
Originally Posted by N0FeaR View Post
Then we need the code so we can help you.
Which code would you need?
SafewayLol is offline   Reply With Quote
Old 09/11/2012, 11:13 PM   #6
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,308
Reputation: 167
Default Re: Businesses

I think the /buybiz.

says this when u type /buybiz "you are not near a buyable business"?
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 09/11/2012, 11:15 PM   #7
SafewayLol
Little Clucker
 
Join Date: Nov 2012
Posts: 10
Reputation: 0
Default Re: Businesses

Code:
CMD:buybiz(playerid, params[])
{
	new string[128], done;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
   	if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVBiz] && PlayerInfo[playerid][pVIP] >= 4) return SendClientMessage(playerid, COLOR_GREY, "You already own two businesses.");
	if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVIP] < 4) return SendClientMessage(playerid, COLOR_GREY, "You already own a business.");
	for(new idx=1; idx<MAX_BIZ; idx++)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
	    {
			if(!strcmp("The State", BizInfo[idx][bOwner], false))
			{
			    if(PlayerInfo[playerid][pMoney] < BizInfo[idx][bPrice]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this business.");
				GiveZaiatMoney(playerid, -BizInfo[idx][bPrice]);
				if(PlayerInfo[playerid][pBiz]) PlayerInfo[playerid][pVBiz] = idx;
				else PlayerInfo[playerid][pBiz] = idx;
			    format(BizInfo[idx][bOwner], 32, "%s", RPNU(playerid));
			    format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", idx, RBT(idx), BizInfo[idx][bOwner], RBS(idx));
				UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a business.");
				SendClientMessage(playerid, COLOR_WHITE, " Type /bizhelp to view your business commands.");
				format(string, sizeof(string), "%s has bought business id %d.", RPN(playerid), idx);
				Log("logs/business.log", string);
				idx = MAX_BIZ;
				done = 1;
			}
			if(idx == MAX_BIZ-1 && !done)
			{
			    SendClientMessage(playerid, COLOR_GREY, "This business is owned by someone else.");
			}
	    }
	    if(idx == MAX_BIZ-1 && !done)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable business.");
	    }
	}
	return 1;
}
When i go to the business icon to enter the interior, The only 3D Text says is "business" Doesn't say its buyable / Current owner etc from it, Also i cant buy anything from inside the initeror
SafewayLol is offline   Reply With Quote
Old 09/11/2012, 11:22 PM   #8
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,308
Reputation: 167
Default Re: Businesses

try this.
pawn Code:
}

CMD:buybiz(playerid, params[])
{
    new string[128], done;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVBiz] && PlayerInfo[playerid][pVIP] >= 4) return SendClientMessage(playerid, COLOR_GREY, "You already own two businesses.");
    if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVIP] < 4) return SendClientMessage(playerid, COLOR_GREY, "You already own a business.");
    for(new idx=1; idx<MAX_BIZ; idx++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            if(!strcmp("The State", BizInfo[idx][bOwner], false))
            {
                if(PlayerInfo[playerid][pMoney] < BizInfo[idx][bPrice]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this business.");
                GiveZaiatMoney(playerid, -BizInfo[idx][bPrice]);
                if(PlayerInfo[playerid][pBiz]) PlayerInfo[playerid][pVBiz] = idx;
                else PlayerInfo[playerid][pBiz] = idx;
                format(BizInfo[idx][bOwner], 32, "%s", RPNU(playerid));
                format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", idx, RBT(idx), BizInfo[idx][bOwner], RBS(idx));
                UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
                SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a business.");
                SendClientMessage(playerid, COLOR_WHITE, " Type /bizhelp to view your business commands.");
                format(string, sizeof(string), "%s has bought business id %d.", RPN(playerid), idx);
                Log("logs/business.log", string);
                idx = MAX_BIZ;
                done = 1;
            }
            if(idx == MAX_BIZ-1 && !done)
            {
                SendClientMessage(playerid, COLOR_GREY, "This business is owned by someone else.");
            }
        }
        if(idx == MAX_BIZ-1 && !done)
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable business.");
        }
    }
    return 1;
}
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 09/11/2012, 11:34 PM   #9
SafewayLol
Little Clucker
 
Join Date: Nov 2012
Posts: 10
Reputation: 0
Default Re: Businesses

Seems the same, The problem is.. When entering a business i can't buy it, I can't buy from it, for example i went into binco clothes store it says "/enter to enter" entered and then did /buybiz says not near a buyable business, Then tried /buybiz on the business icon, Same again. Then tried /buyclothes and it says im not in a clothes shop :S
SafewayLol is offline   Reply With Quote
Reply

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
businesses SpiderWalk Help Archive 2 28/04/2011 11:15 AM
[FilterScript] Businesses!!! darkknight123 Filterscripts 2 25/01/2011 04:29 PM
HELP Businesses ZmaXy Help Archive 5 03/11/2010 01:21 PM
Businesses qwqwqw Help Archive 2 10/05/2010 02:12 AM


All times are GMT. The time now is 04:47 PM.


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