Businesses
#1

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
Reply
#2

U shall post this on zGaming script thread...
Reply
#3

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
Reply
#4

Then we need the code so we can help you.
Reply
#5

Quote:
Originally Posted by N0FeaR
View Post
Then we need the code so we can help you.
Which code would you need?
Reply
#6

I think the /buybiz.

says this when u type /buybiz "you are not near a buyable business"?
Reply
#7

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
Reply
#8

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;
}
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)