Need help about /editbiz(zcmd)
#1

Damn, im tired trying to fix the bug, when im going to /editbiz id | its always set to 0 same with /editbiz name | not working /editbiz type | set to 0 and /editbiz products set to 0 always damn i really need help

pawn Код:
CMD:editbiz(playerid, params[])
{
    if(IsPlayerConnected(playerid)) {
   
        new x_job[128];
        new biz = BizEditID[playerid];
        if(PlayerInfo[playerid][pAdmin] < 99998) {
            SendClientMessage(playerid, COLOR_RED, "   You are not authorised to use this command");
            return 1;
        }
        if(sscanf(params, "s[128]", x_job)) {
            if(BizEditID[playerid] == 999) {
                SendClientMessage(playerid, COLOR_RED, "Use /editbiz ID [BizID] to choose the business to edit");
                return 1;
            }
            else {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz [name]");
                SendClientMessage(playerid, COLOR_GRAD1, "Available names: ID, Interior, Intmenu, Exterior, Price, Type, Name, Sellbiz, Reset, VW, Products");
                return 1;
            }
        }
        if(strcmp(x_job,"Interior",true) == 0) {
            new interior = GetPlayerInterior(playerid);
            new vw = 1000 + random(199999999999999999);
            new Float:posx, Float:posy, Float:posz, Float:posa;
            GetPlayerPos(playerid, posx, posy, posz);
            GetPlayerFacingAngle(playerid, posa);
            new Float:angle = posa + 180.0000;
            BizInfo[biz][bIntLocationx] = posx;
            BizInfo[biz][bIntLocationy] = posy;
            BizInfo[biz][bIntLocationz] = posz;
            BizInfo[biz][bInterior] = interior;
            BizInfo[biz][bVirtualWorld] = vw;
            BizInfo[biz][bExitAngle] = angle;
            SetPlayerVirtualWorld(playerid, vw);
            PlayerInfo[playerid][pVW] = vw;
            PlayerInfo[playerid][pInBiz] = biz;
            SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have changed this business interior.");
            return 1;
        }
        else if(strcmp(x_job,"intmenu",true) == 0) {
            ShowPlayerDialog(playerid, 9974,DIALOG_STYLE_LIST, "Business Interior Menu", "Bank\nCity Hall\nLSPD\nGym\nDrug House\nCrack Lab\n24/7\nAmmunation 1\nAmmunation 2\nAmmunation 3\nAmmunation 4\nAmmunation 5\nBinco\nDidier sachs\nProlaps\nSuburban\nVictim\nZip\nClub\nBar\nResturant\nPhone Company\nLottery", "Set Interior", "Cancel");
            return 1;
        }
        else if(strcmp(params,"Reset",true) == 0) {
            if(PlayerInfo[playerid][pAdmin] < 100000) {
                SendClientMessage(playerid, COLOR_GREY, "   Only for server owner !");
                return 1;
            }
            BizInfo[biz][bLocation_x] = 0.0000;
            BizInfo[biz][bLocation_y] = 0.0000;
            BizInfo[biz][bLocation_z] = 0.0000;
            BizInfo[biz][bInterior] = 0;
            BizInfo[biz][bVirtualWorld] = 0;
            BizInfo[biz][bExitAngle] = 0.0000;
            BizInfo[biz][bEnterAngle] = 0.0000;
            BizInfo[biz][bIntLocationx] = 0.0000;
            BizInfo[biz][bIntLocationy] = 0.0000;
            BizInfo[biz][bIntLocationz] = 0.0000;
            strmid(BizInfo[biz][bOwner], "The State", 0, strlen("The State"), 255);
            strmid(BizInfo[biz][bName], "None", 0, strlen("None"), 255);
            BizInfo[biz][bLocked] = 0;
            BizInfo[biz][bOwned] = 0;
            BizInfo[biz][bType] = 0;
            BizInfo[biz][bCameras] = 0;
            BizInfo[biz][bTill] = 0;
            BizInfo[biz][bFee] = 0;
            DestroyDynamicMapIcon(BizIcon[biz]);
            DestroyDynamicPickup(BizPickup[biz]);
            DestroyDynamic3DTextLabel(BizLabel[biz]);
            SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have reseted this business.");
            return 1;
        }
        else if(strcmp(x_job,"Exterior",true) == 0) {
            new pickup;
            if(BizInfo[biz][bType] == 0) {
                pickup = 1239;
            }
            else if(BizInfo[biz][bType] != 0) {
                pickup = 1272;
            }
            new Float:posx, Float:posy, Float:posz, Float:posa;
            GetPlayerPos(playerid, posx, posy, posz);
            new interiorz = GetPlayerInterior(playerid);
            new pvw = GetPlayerVirtualWorld(playerid);
            GetPlayerFacingAngle(playerid, posa);
            new Float:angle = posa + 180.0000;
            BizInfo[biz][bLocation_x] = posx;
            BizInfo[biz][bLocation_y] = posy;
            BizInfo[biz][bLocation_z] = posz;
            BizInfo[biz][bEnterAngle] = angle;
            BizInfo[biz][bPInt] = interiorz;
            BizInfo[biz][bPVW] = pvw;
            DestroyDynamicPickup(BizPickup[biz]);
            DestroyDynamic3DTextLabel(BizLabel[biz]);
            BizPickup[biz] = CreateDynamicPickup(pickup, 1, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
            SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have changed this business entrance.");
            if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] != 0) {
                new VString[255];
                new price = BizInfo[biz][bPrice];
                format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
                DestroyDynamicMapIcon(BizIcon[biz]);
                if(BizInfo[biz][bType] == 1)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
                else if(BizInfo[biz][bType] == 2)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
                else if(BizInfo[biz][bType] == 3)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
                else if(BizInfo[biz][bType] == 4)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
                else if(BizInfo[biz][bType] == 5)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
                else if(BizInfo[biz][bType] == 6)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
                else if(BizInfo[biz][bType] == 7)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
                else if(BizInfo[biz][bType] == 8)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);

            }
            if(BizInfo[biz][bOwned] == 1 && BizInfo[biz][bType] != 0) {
                new VString[255];
                new name[25], owner[MAX_PLAYER_NAME];
                strmid(owner, BizInfo[biz][bOwner], 0, strlen(BizInfo[biz][bOwner]), 255);
                strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
                format(VString,sizeof(VString),"%s \nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[biz][bFee]);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
                DestroyDynamicMapIcon(BizIcon[biz]);
                if(BizInfo[biz][bType] == 1)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
                else if(BizInfo[biz][bType] == 2)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
                else if(BizInfo[biz][bType] == 3)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
                else if(BizInfo[biz][bType] == 4)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
                else if(BizInfo[biz][bType] == 5)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
                else if(BizInfo[biz][bType] == 6)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
                else if(BizInfo[biz][bType] == 7)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
                else if(BizInfo[biz][bType] == 8)
                    BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);

            }
            if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] == 0) {

                new VString[255];
                new name[25];
                strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
                format(VString,sizeof(VString),"%s", name);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);

            }
            return 1;

        }
        else if(strcmp(x_job,"Price",true) == 0) {

            new price;
            if(isnull(params)) {

                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Price [price]");
                return 1;

            }
            if(BizInfo[biz][bOwned] == 1) {

                SendClientMessage(playerid, COLOR_GREY, "   The business is owned");
                return 1;

            }
            if(BizInfo[biz][bType] == 0) {

                SendClientMessage(playerid, COLOR_GREY, "   The business is not buyable");
                return 1;

            }
            if(price > 50000000 || price < 0) {

                SendClientMessage(playerid, COLOR_GREY, "   The price must be between $1 - $50,000,000 !");
                return 1;

            }
            BizInfo[biz][bPrice] = price;
            DestroyDynamic3DTextLabel(BizLabel[biz]);
            new VString[255];
            new string[128];
            format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
            BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
            format(string, sizeof(string), "You have set this business price to %d.", price);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return 1;

        }

        else if(strcmp(x_job,"Type",true) == 0) {

            new type = strval(params);
            if(isnull(params)) {

                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Type [0-8]");
                SendClientMessage(playerid, COLOR_GREY, "Available types: 0 - Normal building | 1 - 24/7 | 2 - Club | 3 - Ammunation | 4 - Restaurant");
                SendClientMessage(playerid, COLOR_GREY, "Available types: 5 - Clothing store | 6 - Phone company | 7 - Ad Company | 8 - Lottery");
                return 1;

            }
            if(type < 0 || type > 8) {

                SendClientMessage(playerid, COLOR_GREY, "   The biz type must be between 0 - 8 !");
                return 1;

            }
            BizInfo[biz][bType] = type;
            DestroyDynamic3DTextLabel(BizLabel[biz]);
            DestroyDynamicPickup(BizPickup[biz]);
            if(type == 0) {

                BizPickup[biz] = CreateDynamicPickup(1239, 1, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);

            }
            else if(type != 0) {

                if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] != 0) {

                    new VString[255];
                    new price = BizInfo[biz][bPrice];
                    format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
                    BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
                    DestroyDynamicMapIcon(BizIcon[biz]);
                    if(BizInfo[biz][bType] == 1)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
                    else if(BizInfo[biz][bType] == 2)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
                    else if(BizInfo[biz][bType] == 3)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
                    else if(BizInfo[biz][bType] == 4)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
                    else if(BizInfo[biz][bType] == 5)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
                    else if(BizInfo[biz][bType] == 6)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
                    else if(BizInfo[biz][bType] == 7)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
                    else if(BizInfo[biz][bType] == 8)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);

                }
                if(BizInfo[biz][bOwned] == 1 && BizInfo[biz][bType] != 0) {

                    new VString[255];
                    new name[25], owner[MAX_PLAYER_NAME];
                    strmid(owner, BizInfo[biz][bOwner], 0, strlen(BizInfo[biz][bOwner]), 255);
                    strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
                    format(VString,sizeof(VString),"%s \nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[biz][bFee]);
                    BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
                    DestroyDynamicMapIcon(BizIcon[biz]);
                    if(BizInfo[biz][bType] == 1)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
                    else if(BizInfo[biz][bType] == 2)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
                    else if(BizInfo[biz][bType] == 3)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
                    else if(BizInfo[biz][bType] == 4)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
                    else if(BizInfo[biz][bType] == 5)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
                    else if(BizInfo[biz][bType] == 6)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
                    else if(BizInfo[biz][bType] == 7)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
                    else if(BizInfo[biz][bType] == 8)
                        BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);

                }
                if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] == 0) {

                    new VString[255];
                    new name[25];
                    strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
                    format(VString,sizeof(VString),"%s", name);
                    BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
                    DestroyDynamicMapIcon(BizIcon[biz]);

                }
                BizPickup[biz] = CreateDynamicPickup(1272, 1, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);

            }
            new string[128];
            format(string, sizeof(string), "You have set this business type to %d.", type);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return 1;

        }

        else if(strcmp(x_job,"ID",true) == 0) {

            new bid = strval(params);
            if(isnull(params))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz ID [BizID]");
                return 1;
            }
            if(bid < 0 || bid > 199) {

                SendClientMessage(playerid, COLOR_GREY, "   The id must be between 0 - 199 !");
                return 1;

            }
            new string[128];
            BizEditID[playerid] = bid;
            format(string, sizeof(string), "You are now editing the biz id %d.", bid);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return 1;

        }
        else if(strcmp(x_job,"Name",true) == 0) {
            new length = strlen(params);
            new idx;
            while ((idx < length) && (params[idx] <= ' ')) {

                idx++;

            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
                result[idx - offset] = params[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!isnull(result)) {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Name [Name]");
                return 1;
            }
            if(InvalidChar(result) == 1) {
                SendClientMessage(playerid, COLOR_GREY, "   ERROR: cannot contain invalid characters  !");
                return 1;
            }
            strmid(BizInfo[biz][bName], result, 0, strlen(result), 25);
            DestroyDynamic3DTextLabel(BizLabel[biz]);
            if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] != 0) {
                new VString[255];
                new price = BizInfo[biz][bPrice];
                format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
            }
            if(BizInfo[biz][bOwned] == 1 && BizInfo[biz][bType] != 0) {
                new VString[255];
                new name[25], owner[MAX_PLAYER_NAME];
                strmid(owner, BizInfo[biz][bOwner], 0, strlen(BizInfo[biz][bOwner]), 255);
                strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
                format(VString,sizeof(VString),"%s \nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[biz][bFee]);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
            }
            if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] == 0) {
                new VString[255];
                new name[25];
                strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
                format(VString,sizeof(VString),"%s", name);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
            }
            new string[128];
            format(string, sizeof(string), "You have set this biz name to %s.", result);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return 1;
        }
        else if(strcmp(x_job,"VW",true) == 0) {
            new vw = strval(params);
            if(isnull(params)) {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz VW [VirtualWorld]");
                return 1;
            }
            new string[128];
            BizInfo[biz][bVirtualWorld] = vw;
            format(string, sizeof(string), "You have set this biz virtual world to %d.", vw);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return 1;

        }
        else if(strcmp(x_job,"Products",true) == 0) {
            new prod = strval(params);
            if(isnull(params)) {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Products [amount]");
                return 1;
            }
            new string[128];
            BizInfo[biz][bProducts] = prod;
            format(string, sizeof(string), "You have set this biz products to %d.", prod);
            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
            return 1;
        }
        else if(strcmp(x_job,"Sellbiz",true) == 0) {
            if(!isnull(params)) {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Sellbiz [confirm]");
                SendClientMessage(playerid, COLOR_YELLOW,"Are you sure ? !");
                return 1;

            }
            if(strcmp(params,"confirm",true) == 0) {
                if(BizInfo[biz][bOwned] == 0) {
                    SendClientMessage(playerid, COLOR_GRAD1, "   This biz is not owned !");
                    return 1;
                }
                BizInfo[biz][bOwned] = 0;
                BizInfo[biz][bLocked] = 0;
                DestroyDynamic3DTextLabel(BizLabel[biz]);
                strmid(BizInfo[biz][bOwner], "The State", 0, strlen("The State"), 255);
                new VString[255];
                new price = BizInfo[biz][bPrice];
                format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
                BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
                SendClientMessage(playerid,COLOR_YELLOW, "Biz sold !");
            }
        }
        else {
            return 1;
        }
    }
    return 1;
}
Reply
#2

pawn Код:
if(sscanf(params, "s[128]", x_job)) {
um your getting as string here instead of an id.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)