Command Bugged.
#1

I want to make this command for Admin Rank 99998 + and ShopTechs only only ,but whenever i try to do it it says "You aren't authorized to use this command"
pawn Код:
CMD:bedit(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], choice[32], houseid, amount;
    if(sscanf(params, "s[32]dD", choice, houseid, amount))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bedit [name] [business id] [(Optional)amount]");
        SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, Type (1-3) (Leisure, Consumer, Retail), Level, Price, Delete");
        return 1;
    }

    if(strcmp(choice, "delete", true) == 0)
    {
        ClearBusiness(houseid);
        format(string, sizeof(string), "%s has removed Business ID %d", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "interior", true) == 0)
    {
        GetPlayerPos(playerid, BizInfo[houseid][bInteriorX], BizInfo[houseid][bInteriorY], BizInfo[houseid][bInteriorZ]);
        GetPlayerFacingAngle(playerid, BizInfo[houseid][bInteriorA]);
        BizInfo[houseid][bHInteriorWorld] = GetPlayerInterior( playerid );
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the interior!" );
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Interior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "custominterior", true) == 0)
    {
        if(BizInfo[houseid][bCustomInterior] == 0)
        {
            BizInfo[houseid][bCustomInterior] = 1;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to custom interior!" );
        }
        else
        {
            BizInfo[houseid][bCustomInterior] = 0;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to normal (not custom) interior!" );
        }
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Custom Interior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "customexterior", true) == 0)
    {
        if(BizInfo[houseid][bCustomExterior] == 0)
        {
            BizInfo[houseid][bCustomExterior] = 1;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to custom exterior!" );
        }
        else
        {
            BizInfo[houseid][bCustomExterior] = 0;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to normal (not custom) exterior!" );
        }
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Custom Exterior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "exterior", true) == 0)
    {
        GetPlayerPos(playerid, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        GetPlayerFacingAngle(playerid, BizInfo[houseid][bExteriorA]);
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior!" );
        //DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Exterior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        if(BizInfo[houseid][bOwned] ==0)
        {
            DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
            DestroyDynamic3DTextLabel(BizInfo[houseid][bTextID]);
            format(string, sizeof(string), "This business is\n for sale!\nDescription: %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);
            BizInfo[houseid][bTextID] = CreateDynamic3DTextLabel( string, COLOR_LIGHTBLUE, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
            BizInfo[houseid][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        }
        else
        {
            DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
            DestroyDynamic3DTextLabel(BizInfo[houseid][bTextID]);
            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);
            BizInfo[houseid][bTextID] = CreateDynamic3DTextLabel(string,COLOR_LIGHTBLUE,BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
            BizInfo[houseid][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        }
        SaveBusinesses();
    }
    else if(strcmp(choice, "level", true) == 0)
    {
        BizInfo[houseid][bLevel] = amount;
        format(string, sizeof(string), "You have set the business level to %d.", amount);
        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 Level to %d.", GetPlayerNameEx(playerid), houseid, amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "price", true) == 0)
    {
        BizInfo[houseid][bValue] = amount;
        format(string, sizeof(string), "You have set the businesses price to $%d.", amount );
        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);
        }

        format(string, sizeof(string), "%s has edited Business ID %d's Price to $%d.", GetPlayerNameEx(playerid), amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "type", true) == 0)
    {
        switch(amount)
        {
        case 1:
            {
                BizInfo[houseid][bType] = 1;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 1 (Leisure)" );
            }
        case 2:
            {
                BizInfo[houseid][bType] = 2;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 2 (Consumer)" );
            }
        case 3:
            {
                BizInfo[houseid][bType] = 3;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 3 (Retail)" );
            }
        }
        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);
        }

        format(string, sizeof(string), "%s has edited Business ID %d's Type to %d.", GetPlayerNameEx(playerid), houseid, amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    SaveBusinesses();
    return 1;
}
Reply
#2

Код:
if(PlayerInfo[playerid][pAdmin] >= 1339 && PlayerInfo[playerid][pShopTech] == 1)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
        return 1;
    }
You have used the wrong ">" bracket. Anything above 1339 will be unathorized. anything below can use it.
Change ">" to "<"
Reply
#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
#4

You still have used the wrong bracket. It should be ">=" instead of "<=".

Read about the operators: https://sampwiki.blast.hk/wiki/Control_Structures#Operators
Reply
#5

now its Wierd o.O ,if i did /bedit it says "You are not authorized to use that command" but it only works with admin rank 1339
pawn Код:
CMD:bedit(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 99998 || PlayerInfo[playerid][pShopTech] == 1)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
        return 1;
    }

    new string[128], choice[32], houseid, amount;
    if(sscanf(params, "s[32]dD", choice, houseid, amount))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bedit [name] [business id] [(Optional)amount]");
        SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, Type (1-3) (Leisure, Consumer, Retail), Level, Price, Delete");
        return 1;
    }

    if(strcmp(choice, "delete", true) == 0)
    {
        ClearBusiness(houseid);
        format(string, sizeof(string), "%s has removed Business ID %d", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "interior", true) == 0)
    {
        GetPlayerPos(playerid, BizInfo[houseid][bInteriorX], BizInfo[houseid][bInteriorY], BizInfo[houseid][bInteriorZ]);
        GetPlayerFacingAngle(playerid, BizInfo[houseid][bInteriorA]);
        BizInfo[houseid][bHInteriorWorld] = GetPlayerInterior( playerid );
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the interior!" );
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Interior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "custominterior", true) == 0)
    {
        if(BizInfo[houseid][bCustomInterior] == 0)
        {
            BizInfo[houseid][bCustomInterior] = 1;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to custom interior!" );
        }
        else
        {
            BizInfo[houseid][bCustomInterior] = 0;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to normal (not custom) interior!" );
        }
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Custom Interior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "customexterior", true) == 0)
    {
        if(BizInfo[houseid][bCustomExterior] == 0)
        {
            BizInfo[houseid][bCustomExterior] = 1;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to custom exterior!" );
        }
        else
        {
            BizInfo[houseid][bCustomExterior] = 0;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to normal (not custom) exterior!" );
        }
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Custom Exterior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "exterior", true) == 0)
    {
        GetPlayerPos(playerid, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        GetPlayerFacingAngle(playerid, BizInfo[houseid][bExteriorA]);
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior!" );
        //DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Exterior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        if(BizInfo[houseid][bOwned] ==0)
        {
            DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
            DestroyDynamic3DTextLabel(BizInfo[houseid][bTextID]);
            format(string, sizeof(string), "This business is\n for sale!\nDescription: %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);
            BizInfo[houseid][bTextID] = CreateDynamic3DTextLabel( string, COLOR_LIGHTBLUE, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
            BizInfo[houseid][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        }
        else
        {
            DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
            DestroyDynamic3DTextLabel(BizInfo[houseid][bTextID]);
            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);
            BizInfo[houseid][bTextID] = CreateDynamic3DTextLabel(string,COLOR_LIGHTBLUE,BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
            BizInfo[houseid][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        }
        SaveBusinesses();
    }
    else if(strcmp(choice, "level", true) == 0)
    {
        BizInfo[houseid][bLevel] = amount;
        format(string, sizeof(string), "You have set the business level to %d.", amount);
        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 Level to %d.", GetPlayerNameEx(playerid), houseid, amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "price", true) == 0)
    {
        BizInfo[houseid][bValue] = amount;
        format(string, sizeof(string), "You have set the businesses price to $%d.", amount );
        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);
        }

        format(string, sizeof(string), "%s has edited Business ID %d's Price to $%d.", GetPlayerNameEx(playerid), amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "type", true) == 0)
    {
        switch(amount)
        {
        case 1:
            {
                BizInfo[houseid][bType] = 1;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 1 (Leisure)" );
            }
        case 2:
            {
                BizInfo[houseid][bType] = 2;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 2 (Consumer)" );
            }
        case 3:
            {
                BizInfo[houseid][bType] = 3;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 3 (Retail)" );
            }
        }
        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);
        }

        format(string, sizeof(string), "%s has edited Business ID %d's Type to %d.", GetPlayerNameEx(playerid), houseid, amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    SaveBusinesses();
    return 1;
}
and this command works with rank 1339 and lower
pawn Код:
CMD:bname(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 99998 || 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
#6

Bump
Reply
#7

Code:
pawn Код:
CMD:bedit(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 99998 || PlayerInfo[playerid][pShopTech] < 1)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
        return 1;
    }

    new string[128], choice[32], houseid, amount;
    if(sscanf(params, "s[32]dD", choice, houseid, amount))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bedit [name] [business id] [(Optional)amount]");
        SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, Type (1-3) (Leisure, Consumer, Retail), Level, Price, Delete");
        return 1;
    }

    if(strcmp(choice, "delete", true) == 0)
    {
        ClearBusiness(houseid);
        format(string, sizeof(string), "%s has removed Business ID %d", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "interior", true) == 0)
    {
        GetPlayerPos(playerid, BizInfo[houseid][bInteriorX], BizInfo[houseid][bInteriorY], BizInfo[houseid][bInteriorZ]);
        GetPlayerFacingAngle(playerid, BizInfo[houseid][bInteriorA]);
        BizInfo[houseid][bHInteriorWorld] = GetPlayerInterior( playerid );
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the interior!" );
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Interior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "custominterior", true) == 0)
    {
        if(BizInfo[houseid][bCustomInterior] == 0)
        {
            BizInfo[houseid][bCustomInterior] = 1;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to custom interior!" );
        }
        else
        {
            BizInfo[houseid][bCustomInterior] = 0;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to normal (not custom) interior!" );
        }
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Custom Interior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "customexterior", true) == 0)
    {
        if(BizInfo[houseid][bCustomExterior] == 0)
        {
            BizInfo[houseid][bCustomExterior] = 1;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to custom exterior!" );
        }
        else
        {
            BizInfo[houseid][bCustomExterior] = 0;
            SendClientMessageEx( playerid, COLOR_WHITE, "House set to normal (not custom) exterior!" );
        }
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Custom Exterior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "exterior", true) == 0)
    {
        GetPlayerPos(playerid, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        GetPlayerFacingAngle(playerid, BizInfo[houseid][bExteriorA]);
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior!" );
        //DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
        SaveBusinesses();

        format(string, sizeof(string), "%s has edited Business ID %d's Exterior.", GetPlayerNameEx(playerid), houseid);
        Log("logs/bedit.log", string);
        if(BizInfo[houseid][bOwned] ==0)
        {
            DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
            DestroyDynamic3DTextLabel(BizInfo[houseid][bTextID]);
            format(string, sizeof(string), "This business is\n for sale!\nDescription: %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);
            BizInfo[houseid][bTextID] = CreateDynamic3DTextLabel( string, COLOR_LIGHTBLUE, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
            BizInfo[houseid][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        }
        else
        {
            DestroyDynamicPickup(BizInfo[houseid][bPickupID]);
            DestroyDynamic3DTextLabel(BizInfo[houseid][bTextID]);
            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);
            BizInfo[houseid][bTextID] = CreateDynamic3DTextLabel(string,COLOR_LIGHTBLUE,BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]+0.5,30.0, .testlos = 1, .streamdistance = 30.0);
            BizInfo[houseid][bPickupID] = CreateDynamicPickup(1274, 23, BizInfo[houseid][bExteriorX], BizInfo[houseid][bExteriorY], BizInfo[houseid][bExteriorZ]);
        }
        SaveBusinesses();
    }
    else if(strcmp(choice, "level", true) == 0)
    {
        BizInfo[houseid][bLevel] = amount;
        format(string, sizeof(string), "You have set the business level to %d.", amount);
        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 Level to %d.", GetPlayerNameEx(playerid), houseid, amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "price", true) == 0)
    {
        BizInfo[houseid][bValue] = amount;
        format(string, sizeof(string), "You have set the businesses price to $%d.", amount );
        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);
        }

        format(string, sizeof(string), "%s has edited Business ID %d's Price to $%d.", GetPlayerNameEx(playerid), amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    else if(strcmp(choice, "type", true) == 0)
    {
        switch(amount)
        {
        case 1:
            {
                BizInfo[houseid][bType] = 1;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 1 (Leisure)" );
            }
        case 2:
            {
                BizInfo[houseid][bType] = 2;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 2 (Consumer)" );
            }
        case 3:
            {
                BizInfo[houseid][bType] = 3;
                SendClientMessageEx(playerid, COLOR_WHITE, "You have set the businesses type to 3 (Retail)" );
            }
        }
        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);
        }

        format(string, sizeof(string), "%s has edited Business ID %d's Type to %d.", GetPlayerNameEx(playerid), houseid, amount);
        Log("logs/bedit.log", string);
        SaveBusinesses();
    }
    SaveBusinesses();
    return 1;
}

CMD:bname(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 99998 || 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
#8

You know i warned you once about not to use that copyrighted script they will take it into there own hands and sew you... Your not allowed to have the Project: Los Angeles Script.
Reply
#9

Quote:
Originally Posted by FutureGenerationGaming
Посмотреть сообщение
You know i warned you once about not to use that copyrighted script they will take it into there own hands and sew you... Your not allowed to have the Project: Los Angeles Script.
its non of your business and its not a copyrighted script
EDIT:P:LA Stole NGG Script And edited to make their server and there are many other server using this script not only us so stop saying that its Copyrighted.
Reply
#10

Quote:
Originally Posted by Drago987
Посмотреть сообщение
its non of your business and its not a copyrighted script
EDIT:P:LA Stole NGG Script And edited to make their server and there are many other server using this script not only us so stop saying that its Copyrighted.
Actuality you made a BIG mistake, we have talked to the people owning the other script, but PLA changed the NGG script completely if you want to know what my identity is please PM me, I will be happy to share you because when i logged onto your server i got banned for "Fake". But anyways. here ya go,

Код:
/*
			 ____                                  __                                                  
			/\  _`\              __               /\ \__                                               
			\ \ \L\ \_ __   ___ /\_\     __    ___\ \ ,_\                                              
			 \ \ ,__/\`'__\/ __`\/\ \  /'__`\ /'___\ \ \/                                              
			  \ \ \/\ \ \//\ \L\ \ \ \/\  __//\ \__/\ \ \_                                             
			   \ \_\ \ \_\\ \____/\ \ \ \____\ \____\\ \__\                                            
				\/_/  \/_/ \/___/\ \_\ \/____/\/____/ \/__/                                            
			 __                 \ \____/ ______                          ___                           
			/\ \                 \/___/ /\  _  \                        /\_ \                          
			\ \ \        ___     ____   \ \ \L\ \    ___      __      __\//\ \      __    ____         
			 \ \ \  __  / __`\  /',__\   \ \  __ \ /' _ `\  /'_ `\  /'__`\\ \ \   /'__`\ /',__\        
			  \ \ \L\ \/\ \L\ \/\__, `\   \ \ \/\ \/\ \/\ \/\ \L\ \/\  __/ \_\ \_/\  __//\__, `\
			   \ \____/\ \____/\/\____/    \ \_\ \_\ \_\ \_\ \____ \ \____\/\____\ \____\/\____/       
				\/___/  \/___/  \/___/      \/_/\/_/\/_/\/_/\/___L\ \/____/\/____/\/____/\/___/        
															  /\____/                                  
															  \_/__/     
															  
								Project Los Angeles Roleplay
						© 2012 by Ocean View Gaming. All rights reserved
						(created by Project Los Angeles Development Team)
								( for Project Los Angeles )
		       (Edits Made After Godfather Public Release Copyright 2012 - OV Gaming)
			
			Development Team:
			(***) Brian Pryor
			(**) George Macon
			(**) Alex Bloom
						
			Credits to alternate sources (****** for foreach, gf, etc)
			NOTE: Any scripter has to sign the NDA before getting the script, OV NEVER lets a person who didnt sign the NDA touch the script. OV Gaming has all copyright.
			Server developed in the past by Steve Smith, Brett Summers, Jordan Stullick, Killian Byrnes, Mike_Garber and Billy_Kiscadden.
			Original gamemode courtesy of the public Godfather release.
			Credits to the Project Los Angeles mapping team, for providing the custom maps.
*/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)