[HELP]Business
#8

PHP код:
if(strcmp(cmd"/buybusiness"true) == || strcmp(cmd"/buybiz"true) == 0)
    {
        for(new 
0<MAX_HOUSESi++)
        {
            if (
PlayerToPoint(3.0playeridBusinessInfo[i][bEntrancex], BusinessInfo[i][bEntrancey], BusinessInfo[i][bEntrancez]))
            {
                if(
PlayerInfo[playerid][pLevel] < BusinessInfo[i][bLevel])
                {
                    
format(stringsizeof(string), "You must be level %d to buy this business."BusinessInfo[i][bLevel]);
                    
SendClientMessage(playeridCOLOR_REDstring);
                    return 
1;
                }
                if(
PlayerInfo[playerid][pBusinessKey] != INVALID_BUSINESS_ID)
                {
                    
SendClientMessage(playeridCOLOR_RED"You are already owning a business, sell that first.");
                    return 
1;
                }
                if(
BusinessInfo[i][bOwned] == 1)
                {
                    
SendClientMessage(playeridCOLOR_RED"This business you are trying to buy is already owned.");
                    return 
1;
                }
                if(
GetPlayerMoney(playerid) < BusinessInfo[i][bPrice])
                {
                    
format(stringsizeof(string), "You need %d$ dollars in cash to buy this business."BusinessInfo[i][bPrice]);
                    
SendClientMessage(playeridCOLOR_REDstring);
                    return 
1;
                }
                else
                {
                    
SetPlayerPos(playeridBusinessInfo[i][bExitx], BusinessInfo[i][bExity], BusinessInfo[i][bExitz]);
                    
SetPlayerInterior(playeridBusinessInfo[i][bInt]);
                    
SetPlayerVirtualWorld(playeridBusinessInfo[i][bWorld]);
                    
GivePlayerMoney(playerid, -BusinessInfo[i][bPrice]);
                    
BusinessInfo[i][bOwned] = 1;
                    
strmid(BusinessInfo[i][bOwner], PlayerName[playerid], falsestrlen(PlayerName[playerid]), 25);
                    
PlayerInfo[playerid][pBusinessKey] = i;
                    
PlayerPlaySound(playerid10520.00.00.0);
                    
format(stringsizeof(string), "You have successfully bought this business for %d$."BusinessInfo[i][bPrice]);
                    
SendClientMessage(playeridCOLOR_YELLOWstring);
                    new 
bizzname[32];
                    
strmid(bizznameBusinessInfo[i][bDescription], 3strlen(BusinessInfo[i][bDescription]), 32);
                    
format(stringsizeof(string), "%s has bought business %s."PlayerName[playerid], BusinessInfo[i][bDescription]);
                    
SendClientMessageToAll(COLOR_YELLOWstring);
                    
OnBusinessUpdate();
                    return 
1;
                }
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread
[HELP]Business - by [Aka]Dragonu - 01.09.2011, 11:44
Re: [HELP]Business - by Pinguinn - 01.09.2011, 12:29
Re: [HELP]Business - by [Aka]Dragonu - 01.09.2011, 12:33
Re: [HELP]Business - by Pinguinn - 01.09.2011, 12:34
Re: [HELP]Business - by [Aka]Dragonu - 01.09.2011, 12:37
Re: [HELP]Business - by Jafet_Macario - 01.09.2011, 13:25
Re: [HELP]Business - by [Aka]Dragonu - 01.09.2011, 13:27
Re: [HELP]Business - by Jafet_Macario - 01.09.2011, 13:34
Re: [HELP]Business - by [Aka]Dragonu - 01.09.2011, 13:45

Forum Jump:


Users browsing this thread: 2 Guest(s)