[HELP]Business
#7

Thank you very much, but I have exactly this problem on /buybusiness, here is the code :

pawn Код:
if(strcmp(cmd, "/buybusiness", true) == 0 || strcmp(cmd, "/buybiz", true) == 0)
    {
        for(new i = 0; i <MAX_HOUSES; i++)
        {
            if (PlayerToPoint(3.0, playerid, BusinessInfo[i][bEntrancex], BusinessInfo[i][bEntrancey], BusinessInfo[i][bEntrancez]))
            {
                if(PlayerInfo[playerid][pLevel] < BusinessInfo[i][bLevel])
                {
                    format(string, sizeof(string), "You must be level %d to buy this business.", BusinessInfo[i][bLevel]);
                    SendClientMessage(playerid, COLOR_RED, string);
                    return 1;
                }
                if(PlayerInfo[playerid][pBusinessKey] != INVALID_BUSINESS_ID)
                {
                    SendClientMessage(playerid, COLOR_RED, "You are already owning a business, sell that first.");
                    return 1;
                }
                if(BusinessInfo[i][bOwned] == 1)
                {
                    SendClientMessage(playerid, COLOR_RED, "This business you are trying to buy is already owned.");
                    return 1;
                }
                if(GetPlayerMoney(playerid) < BusinessInfo[i][bPrice])
                {
                    format(string, sizeof(string), "You need %d$ dollars in cash to buy this business.", BusinessInfo[i][bPrice]);
                    SendClientMessage(playerid, COLOR_RED, string);
                    return 1;
                }
                else
                {
                    SetPlayerPos(playerid, BusinessInfo[i][bExitx], BusinessInfo[i][bExity], BusinessInfo[i][bExitz]);
                    SetPlayerInterior(playerid, BusinessInfo[i][bInt]);
                    SetPlayerVirtualWorld(playerid, BusinessInfo[i][bWorld]);
                    GivePlayerMoney(playerid, -BusinessInfo[i][bPrice]);
                    BusinessInfo[i][bOwned] = 1;
                    strmid(BusinessInfo[i][bOwner], PlayerName[playerid], false, strlen(PlayerName[playerid]), 25);
                    PlayerInfo[playerid][pBusinessKey] = i;
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    format(string, sizeof(string), "You have successfully bought this business for %d$.", BusinessInfo[i][bPrice]);
                    SendClientMessage(playerid, COLOR_YELLOW, string);
                    new bizzname[32];
                    strmid(bizzname, BusinessInfo[i][bDescription], 3, strlen(BusinessInfo[i][bDescription]), 32);
                    format(string, sizeof(string), "%s has bought business %s.", PlayerName[playerid], bizzname);
                    SendClientMessageToAll(COLOR_YELLOW, string);
                    OnBusinessUpdate();
                    return 1;
                }
            }
        }
        return 1;
    }
Here is the line that sends the message to the whole server
pawn Код:
strmid(bizzname, BusinessInfo[i][bDescription], 3, strlen(BusinessInfo[i][bDescription]), 32);
                    format(string, sizeof(string), "%s has bought business %s.", PlayerName[playerid], bizzname);
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: 3 Guest(s)