SA-MP Forums Archive
Business interior bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Business interior bug (/showthread.php?tid=470924)



Business interior bug - Lunixx - 20.10.2013

I have a problem
If i try to make new biz and i try to set same interior that other biz has it cant let me have same interior on multiple business. EX: Business 1 has int 1, I try to edit Business 2 to int 1, but if i /exit business i tp to business 1.
pawn Код:
CMD:bedit(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 4)
    {
        SendClientMessageEx(playerid, COLOR_RED, "You are not authorized to use that command!");
        return 1;
    }
    new choice[32],bizid,ammount;
    if(sscanf(params,"s[32]dD",choice,bizid,ammount))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bedit [name] [bizid] [(optional)ammount]");
        SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, Price, Robprice, Input, Type, Lock");
        return 1;
    }
    if(bizid > 500 || bizid < 0) return SendClientMessageEx( playerid, COLOR_WHITE, "Biz id must be from 0 till 500");
    if(strcmp(choice,"interior",true) == 0)
    {
        GetPlayerPos(playerid,BizInfo[bizid][bInteriorX],BizInfo[bizid][bInteriorY],BizInfo[bizid][bInteriorZ]);
        GetPlayerFacingAngle(playerid,BizInfo[bizid][bInteriorA]);
        BizInfo[bizid][bInterior] = GetPlayerInterior(playerid);
        BizInfo[bizid][bInteriorVw] = bizid+5000;
        BizInfo[bizid][bLock] = 1;
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the interior!" );
        if(BizInfo[bizid][bOwned] != 1 && BizInfo[bizid][bOwned] != 0)
        {
            BizInfo[bizid][bOwned] = 0;
            format(BizInfo[bizid][bOwner],128,"Nobody");
            strmid(BizInfo[bizid][bName],"Unnamed",0,7,255);
            BizInfo[bizid][bLock] = 1;
        }
        SaveBiz();
        LoadBiz();
        return 1;
    }
    else if(strcmp(choice,"exterior",true) == 0)
    {
        GetPlayerPos(playerid,BizInfo[bizid][bExteriorX],BizInfo[bizid][bExteriorY],BizInfo[bizid][bExteriorZ]);
        GetPlayerFacingAngle(playerid,BizInfo[bizid][bExteriorA]);
        BizInfo[bizid][bExteriorVw] = GetPlayerVirtualWorld(playerid);
        BizInfo[bizid][bLock] = 1;
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior!" );
        if(BizInfo[bizid][bOwned] != 1 && BizInfo[bizid][bOwned] != 0)
        {
            BizInfo[bizid][bOwned] = 0;
            format(BizInfo[bizid][bOwner],128,"Nobody");
            strmid(BizInfo[bizid][bName],"Unnamed",0,7,255);
            BizInfo[bizid][bLock] = 1;
        }
        SaveBiz();
        LoadBiz();
    }
    else if(strcmp(choice,"price",true) == 0)
    {
        BizInfo[bizid][bPrice] = ammount;
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the price!" );
        if(BizInfo[bizid][bOwned] != 1 && BizInfo[bizid][bOwned] != 0)
        {
            BizInfo[bizid][bOwned] = 0;
            format(BizInfo[bizid][bOwner],128,"Nobody");
            strmid(BizInfo[bizid][bName],"Unnamed",0,7,255);
            BizInfo[bizid][bLock] = 1;
        }
        SaveBiz();
        LoadBiz();
    }
    else if(strcmp(choice,"robprice",true) == 0)
    {
        BizInfo[bizid][bRobPrice] = ammount;
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the rob price!" );
        if(BizInfo[bizid][bOwned] != 1 && BizInfo[bizid][bOwned] != 0)
        {
            BizInfo[bizid][bOwned] = 0;
            format(BizInfo[bizid][bOwner],128,"Nobody");
            strmid(BizInfo[bizid][bName],"Unnamed",0,7,255);
            BizInfo[bizid][bLock] = 1;
        }
        SaveBiz();
        LoadBiz();
    }
    else if(strcmp(choice,"input",true) == 0)
    {
        BizInfo[bizid][bInput] = ammount;
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the input(biz money) value !");
        if(BizInfo[bizid][bOwned] != 1 && BizInfo[bizid][bOwned] != 0)
        {
            BizInfo[bizid][bOwned] = 0;
            format(BizInfo[bizid][bOwner],128,"Nobody");
            strmid(BizInfo[bizid][bName],"Unnamed",0,7,255);
            BizInfo[bizid][bLock] = 1;
        }
        SaveBiz();
        LoadBiz();

    }
    else if(strcmp(choice,"type",true) == 0)
    {
        if(ammount < 1 || ammount > 4) return SendClientMessageEx( playerid, COLOR_WHITE, "Business types: 1 clothes shop / 2 ammunation / 3 crack lab / 4 resturant");
        BizInfo[bizid][bType] = ammount;
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the type !");
        if(BizInfo[bizid][bOwned] != 1 && BizInfo[bizid][bOwned] != 0)
        {
            BizInfo[bizid][bOwned] = 0;
            format(BizInfo[bizid][bOwner],128,"Nobody");
            strmid(BizInfo[bizid][bName],"Unnamed",0,7,255);
            BizInfo[bizid][bLock] = 1;
        }
        SaveBiz();
        LoadBiz();
    }

    else if(strcmp(choice,"lock",true) == 0)
    {
        if(ammount != 1 && ammount == 0) return SendClientMessage(playerid,COLOR_WHITE,"Ammount must be 1/2");
        if(ammount == 1)
        {
            BizInfo[bizid][bLock] = 1;
            GameTextForPlayer(playerid,"~g~ Business ~r~ Locked",2000,3);
            SaveBiz();
        }else{
            BizInfo[bizid][bLock] = 0;
            GameTextForPlayer(playerid,"~g~ Business ~r~ Unlocked",2000,3);
            SaveBiz();
        }
    }
    return 1;
}



Re: Business interior bug - rickisme - 20.10.2013

show me code create business ?
problem is in virtual world


Re: Business interior bug - caoraivoso3 - 20.10.2013

you should make the virtualworld diferent like when the players enter the business he goes to bizid+2
in this way all the building cant enter in conflit.


Re: Business interior bug - Lunixx - 20.10.2013

Can you explain me more detailed?


Re: Business interior bug - Lunixx - 20.10.2013

Fixed