Business Interior
#1

Here's the story:
Business 1 - Ammu-Nation
Business 2 - Ammu-Nation with same interior that Business 1
I enter to Business 2. But if I type /exit I end up at Business 1 Door. Can anyone fix it?
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+3;
        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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)