Command Bugged.
#3

ok it works ,but when i did it with some other commands it didn't work
pawn Код:
CMD:bnext(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 1)
    {
        SendClientMessageEx(playerid, COLOR_RED, "* Listing next available business...");
        for(new i = 0; i < MAX_BUSINESS; i++)
        {
            if(BizInfo[i][bOwned] == 0 && BizInfo[i][bExteriorX] == 0.000000)
            {
                new string[128];
                format(string, sizeof(string), "%d is available to use.", i);
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                break;
            }
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
        return 1;
    }
    return 1;
}

CMD:bnear(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 1)
    {
        SendClientMessageEx(playerid, COLOR_RED, "* Listing all free businesses within the server");
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        for(new i=0;i<MAX_BUSINESS;i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 1250, BizInfo[i][bExteriorX], BizInfo[i][bExteriorY], BizInfo[i][bExteriorZ]))
            {
                if(BizInfo[i][bOwned] == 0 && BizInfo[i][bExteriorX] == 0.000000)
                {
                    new string[128];
                    format(string, sizeof(string), "Business ID: %d", i);
                    SendClientMessageEx(playerid, COLOR_WHITE, string);
                }
            }
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
    }
    return 1;
}
CMD:bname(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 1)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
        return 1;
    }

    new string[128], houseid, desc[24];
    if(sscanf(params, "ds[128]", houseid, desc)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bname [business id] [name]");

    format(BizInfo[houseid][bDescription], 128, "%s", desc);
    format(string, sizeof(string), "You have set the business description to %s", desc);
    SendClientMessageEx(playerid, COLOR_WHITE, string);

    if(BizInfo[houseid][bOwned] == 0)
    {
        format(string, sizeof(string), "This business is\n for sale!\n Description: %s\nCost: $%d\n Level: %d\nType: %d\nID: %d\nTo buy this business type /buybusiness",BizInfo[houseid][bDescription],BizInfo[houseid][bValue],BizInfo[houseid][bLevel],BizInfo[houseid][bType],houseid);
        UpdateDynamic3DTextLabelText(BizInfo[houseid][bTextID], COLOR_LIGHTBLUE, string);
    }
    else
    {
        format(string, sizeof(string), "This business is owned by\n %s\nDescription: %s\nLevel: %d\nType: %d\nID: %d",BizInfo[houseid][bOwner],BizInfo[houseid][bDescription],BizInfo[houseid][bLevel],BizInfo[houseid][bType],houseid);
        UpdateDynamic3DTextLabelText(BizInfo[houseid][bTextID], COLOR_LIGHTBLUE, string);
    }

    format(string, sizeof(string), "%s has edited Business ID %d's description to %s.", GetPlayerNameEx(playerid), houseid, desc);
    Log("logs/bedit.log", string);

    return 1;
}
Reply


Messages In This Thread
Command Bugged. - by Drago987 - 04.03.2014, 18:39
Re: Command Bugged. - by AaronFarley - 04.03.2014, 18:43
Re: Command Bugged. - by Drago987 - 04.03.2014, 19:25
Re: Command Bugged. - by Konstantinos - 04.03.2014, 20:01
Re: Command Bugged. - by Drago987 - 04.03.2014, 20:32
Re: Command Bugged. - by Drago987 - 05.03.2014, 00:16
Re: Command Bugged. - by AchievementMaster360 - 05.03.2014, 00:30
Re: Command Bugged. - by FutureGenerationGaming - 05.03.2014, 01:55
Re: Command Bugged. - by Drago987 - 05.03.2014, 14:52
Re: Command Bugged. - by FutureGenerationGaming - 06.03.2014, 01:14

Forum Jump:


Users browsing this thread: 2 Guest(s)