Jump to content
  • 0

Problema banca,biz..


Bogdan's

Question

Problema intalnita (descriere): Salut deci am o problema la bizul bancii si anume: Intru in banca,si cand apas F sau ENTER sa ies ma scoate pentru o secunda dupa care revin inapoi.
Ero(area / rile) / warning-(ul / urile): Nu am.
Liniile de cod / sursa / script-ul(obligatoriu):

if(newkeys==KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if (PlayerToPoint(3, playerid,HouseInfo[hEntrancex], HouseInfo[hEntrancey], HouseInfo[hEntrancez]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[hLock] == 0)
                    {
                        SetPlayerVirtualWorld(playerid, i);
                          SetPlayerInterior(playerid,HouseInfo[hInt]);
                        SetPlayerPos(playerid,HouseInfo[hExitx],HouseInfo[hExity],HouseInfo[hExitz]);
                        GameTextForPlayer(playerid, "~w~Bun venit acasa", 5000, 1);
                        PlayerInfo[playerid][pInt] = HouseInfo[hInt];
                        PlayerInfo[playerid][pLocal] = i+500;
                        return 1;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~INCHIS", 5000, 1);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(BizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,BizzInfo[bEntranceX], BizzInfo[bEntranceY], BizzInfo[bEntranceZ]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[bEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(BizzInfo[bLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~INCHIS", 5000, 1);
                                return 1;
                            }
                            if(i == 6 || i == 7 || i == 8)
                            {
                                OnPlayerEnterFood(playerid, 3)
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 25)
                            {
                                OnPlayerEnterFood(playerid, 2)
                                SetPlayerInterior(playerid,BizzInfo[25][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[25][bExitX],BizzInfo[25][bExitY],BizzInfo[25][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[25][bInterior];
                                PlayerInfo[playerid][pLocal] = 25+99;
                                SetPlayerVirtualWorld(playerid, 25+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 2)
                            {
                                OnPlayerEnterFood(playerid, 1)
                                SetPlayerInterior(playerid,BizzInfo[2][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[2][bExitX],BizzInfo[2][bExitY],BizzInfo[2][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[2][bInterior];
                                PlayerInfo[playerid][pLocal] = 2+99;
                                SetPlayerVirtualWorld(playerid, 2+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 24)
                            {
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                return 1;
                            }
                            if(i == 5 || i == 14 || i == 15 || i == 9 || i == 10 || i == 11 || i == 12 || i == 13 || i == 16 || i == 17 || i == 19 || i == 20 || i == 21 || i == 22 || i == 23)
                            {
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                            }
                            SafeGivePlayerMoney(playerid,-BizzInfo[bEntranceCost]);
                            format(string, sizeof(string), "~r~-$%d~n~~w~Apasa ENTER~n~pentru a iesi", BizzInfo[bEntranceCost]);
                            BizzInfo[bTill] += BizzInfo[bEntranceCost];
                            OnPropUpdate();
                            GameTextForPlayer(playerid, string, 5000, 3);
                        }
                        if(i == 6 || i == 7 || i == 8)
                        {
                                OnPlayerEnterFood(playerid, 3)
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 25)
                        {
                                OnPlayerEnterFood(playerid, 2)
                                SetPlayerInterior(playerid,BizzInfo[25][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[25][bExitX],BizzInfo[25][bExitY],BizzInfo[25][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[25][bInterior];
                                PlayerInfo[playerid][pLocal] = 25+99;
                                SetPlayerVirtualWorld(playerid, 25+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 2)
                        {
                                OnPlayerEnterFood(playerid, 1)
                                SetPlayerInterior(playerid,BizzInfo[2][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[2][bExitX],BizzInfo[2][bExitY],BizzInfo[2][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[2][bInterior];
                                PlayerInfo[playerid][pLocal] = 2+99;
                                SetPlayerVirtualWorld(playerid, 2+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 5 || i == 14 || i == 15 || i == 9 || i == 10 || i == 11 || i == 12 || i == 13 || i == 16 || i == 17 || i == 19 || i == 20 || i == 21 || i == 22 || i == 23 || i == 24)
                        {
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Apasa ENTER~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        SetPlayerInterior(playerid,BizzInfo[bInterior]);
                        SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                        PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                        PlayerInfo[playerid][pLocal] = i+99;
                        SetPlayerVirtualWorld(playerid, i+99);
                        new dood[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, dood, sizeof(dood));
                        format(string, sizeof(string), "%s a platit $%d pentru a intra la %d", dood, BizzInfo[bEntranceCost], i);
                        printf("%s", string);
                        PayLog(string);
                        //PlayerInfo[playerid][pLocal] = i;
                        return 1;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Nu ai bani", 5000, 1);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[sbEntranceX], SBizzInfo[sbEntranceY], SBizzInfo[sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[sbEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(SBizzInfo[sbLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~Inchis", 5000, 1);
                                return 1;
                            }
                            SafeGivePlayerMoney(playerid,-SBizzInfo[sbEntranceCost]);
                            gSpentCash[playerid] = GetPlayerMoney(playerid);
                            SBizzInfo[sbTill] += SBizzInfo[sbEntranceCost];
                            new dood[MAX_PLAYER_NAME];
                            GetPlayerName(playerid, dood, sizeof(dood));
                            format(string, sizeof(string), "%s a platit $%d pentru a intra la %d", dood, SBizzInfo[sbEntranceCost], i);
                            printf("%s", string);
                            PayLog(string);
                            OnPropUpdate();
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Nu ai bani", 5000, 1);
                        return 1;
                    }
                }
            }
        }
    }


Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da.

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 1

Da.

 

if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if (PlayerToPoint(3, playerid,HouseInfo[hEntrancex], HouseInfo[hEntrancey], HouseInfo[hEntrancez]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[hLock] == 0)
                    {
                        SetPlayerVirtualWorld(playerid, i);
                          SetPlayerInterior(playerid,HouseInfo[hInt]);
                        SetPlayerPos(playerid,HouseInfo[hExitx],HouseInfo[hExity],HouseInfo[hExitz]);
                        GameTextForPlayer(playerid, "~w~Bun venit acasa", 5000, 1);
                        PlayerInfo[playerid][pInt] = HouseInfo[hInt];
                        PlayerInfo[playerid][pLocal] = i+500;
                        return 1;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~INCHIS", 5000, 1);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(BizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,BizzInfo[bEntranceX], BizzInfo[bEntranceY], BizzInfo[bEntranceZ]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[bEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(BizzInfo[bLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~INCHIS", 5000, 1);
                                return 1;
                            }
                            if(i == 6 || i == 7 || i == 8)
                            {
                                OnPlayerEnterFood(playerid, 3)
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 25)
                            {
                                OnPlayerEnterFood(playerid, 2)
                                SetPlayerInterior(playerid,BizzInfo[25][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[25][bExitX],BizzInfo[25][bExitY],BizzInfo[25][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[25][bInterior];
                                PlayerInfo[playerid][pLocal] = 25+99;
                                SetPlayerVirtualWorld(playerid, 25+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 2)
                            {
                                OnPlayerEnterFood(playerid, 1)
                                SetPlayerInterior(playerid,BizzInfo[2][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[2][bExitX],BizzInfo[2][bExitY],BizzInfo[2][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[2][bInterior];
                                PlayerInfo[playerid][pLocal] = 2+99;
                                SetPlayerVirtualWorld(playerid, 2+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 24)
                            {
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                return 1;
                            }
                            if(i == 5 || i == 14 || i == 15 || i == 9 || i == 10 || i == 11 || i == 12 || i == 13 || i == 16 || i == 17 || i == 19 || i == 20 || i == 21 || i == 22 || i == 23)
                            {
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                            }
                            SafeGivePlayerMoney(playerid,-BizzInfo[bEntranceCost]);
                            format(string, sizeof(string), "~r~-$%d~n~~w~scrie /exit~n~pentru a iesi", BizzInfo[bEntranceCost]);
                            BizzInfo[bTill] += BizzInfo[bEntranceCost];
                            OnPropUpdate();
                            GameTextForPlayer(playerid, string, 5000, 3);
                        }
                        if(i == 6 || i == 7 || i == 8)
                        {
                                OnPlayerEnterFood(playerid, 3)
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 25)
                        {
                                OnPlayerEnterFood(playerid, 2)
                                SetPlayerInterior(playerid,BizzInfo[25][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[25][bExitX],BizzInfo[25][bExitY],BizzInfo[25][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[25][bInterior];
                                PlayerInfo[playerid][pLocal] = 25+99;
                                SetPlayerVirtualWorld(playerid, 25+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 2)
                        {
                                OnPlayerEnterFood(playerid, 1)
                                SetPlayerInterior(playerid,BizzInfo[2][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[2][bExitX],BizzInfo[2][bExitY],BizzInfo[2][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[2][bInterior];
                                PlayerInfo[playerid][pLocal] = 2+99;
                                SetPlayerVirtualWorld(playerid, 2+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 5 || i == 14 || i == 15 || i == 9 || i == 10 || i == 11 || i == 12 || i == 13 || i == 16 || i == 17 || i == 19 || i == 20 || i == 21 || i == 22 || i == 23 || i == 24)
                        {
                                SetPlayerInterior(playerid,BizzInfo[bInterior]);
                                SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        SetPlayerInterior(playerid,BizzInfo[bInterior]);
                        SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                        PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                        PlayerInfo[playerid][pLocal] = i+99;
                        SetPlayerVirtualWorld(playerid, i+99);
                        new dood[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, dood, sizeof(dood));
                        format(string, sizeof(string), "%s a platit $%d pentru a intra la %d", dood, BizzInfo[bEntranceCost], i);
                        printf("%s", string);
                        PayLog(string);
                        //PlayerInfo[playerid][pLocal] = i;
                        return 1;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Nu ai bani", 5000, 1);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[sbEntranceX], SBizzInfo[sbEntranceY], SBizzInfo[sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[sbEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(SBizzInfo[sbLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~Inchis", 5000, 1);
                                return 1;
                            }
                            SafeGivePlayerMoney(playerid,-SBizzInfo[sbEntranceCost]);
                            gSpentCash[playerid] = GetPlayerMoney(playerid);
                            SBizzInfo[sbTill] += SBizzInfo[sbEntranceCost];
                            new dood[MAX_PLAYER_NAME];
                            GetPlayerName(playerid, dood, sizeof(dood));
                            format(string, sizeof(string), "%s a platit $%d pentru a intra la %d", dood, SBizzInfo[sbEntranceCost], i);
                            printf("%s", string);
                            PayLog(string);
                            OnPropUpdate();
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Nu ai bani", 5000, 1);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Si exit,poate aveti nevoie.
if(strcmp(cmd, "/exit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i <  sizeof(HouseInfo); i++)
            {
                //printf("House :%d",i);
                if (PlayerToPoint(1.5, playerid,HouseInfo[hExitx], HouseInfo[hExity], HouseInfo[hExitz]) && GetPlayerVirtualWorld(playerid) == i)
                {
                    if(GetPlayerVirtualWorld(playerid) == i)
                    {
                                SetPlayerInterior(playerid, 0);
                            SetPlayerPos(playerid,HouseInfo[hEntrancex],HouseInfo[hEntrancey],HouseInfo[hEntrancez]);
                            PlayerInfo[playerid][pInt] = 0;
                            PlayerInfo[playerid][pLocal] = 999;
                            SetCameraBehindPlayer(playerid);
                            SetPlayerVirtualWorld(playerid,0);
                            if(HouseInfo[hHel] == 1 && HouseInfo[hArm] == 1)
                            {
                                SetPlayerHealth(playerid,99.0);
                                SetPlayerArmour(playerid,99.0);
                                return 1;
                            }
                            if(HouseInfo[hHel] == 1)
                            {
                                SetPlayerHealth(playerid,100.0);
                                return 1;
                            }
                            if(HouseInfo[hArm] == 1)
                            {
                                SetPlayerArmour(playerid,99.0);
                                return 1;
                            }
                    }
                }
            }
            for(new i = 0; i <  sizeof(BizzInfo); i++)
            {
                //printf("Bizz :%d",i);
                if (PlayerToPoint(3, playerid,BizzInfo[bExitX], BizzInfo[bExitY], BizzInfo[bExitZ]))
                {
                    if(GetPlayerVirtualWorld(playerid) == i+99)
                    {
                        SetPlayerInterior(playerid,0);
                        PlayerInfo[playerid][pInt] = 0;
                        SetPlayerPos(playerid,BizzInfo[bEntranceX],BizzInfo[bEntranceY],BizzInfo[bEntranceZ]);
                        PlayerInfo[playerid][pLocal] = 999;
                        SetPlayerVirtualWorld(playerid, 0);
                        OnPlayerExitFood(playerid)
                    }
                }
            }
            new carid = GetPlayerVehicleID(playerid);
            if (IsABus(carid))
            {
                TogglePlayerControllable(playerid, 1);
                //GangZoneHideForPlayer(playerid, buszoneeast);
                //GangZoneHideForPlayer(playerid, buszonewest);
                RemovePlayerFromVehicle(playerid);
                if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, carid);
            }
            if (IsASweeper(carid))
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            if(IsAHarvest(carid))
            {
                if (carid != 0)
                {
                    SetVehicleToRespawn(carid);
                }
                if(FarmerPickup[playerid][0] >= 1 && FarmerPickup[playerid][0] <= 22)
                {
                    FarmerPickup[playerid][0]--;
                }
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                FarmerVar[playerid] = 0;
                DisablePlayerRaceCheckpoint(playerid);
            }
            if(IsADrugHarvest(carid))
            {
                if (carid != 0)
                {
                    SetVehicleToRespawn(carid);
                }
                if(DrugFarmerPickup[playerid][0] >= 1 && DrugFarmerPickup[playerid][0] <= 37)
                {
                    DrugFarmerPickup[playerid][0]--;
                }
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                DrugFarmerVar[playerid] = 0;
                DisablePlayerCheckpoint(playerid);
            }
            if(IsASmuggleCar(carid))
            {
                if(carid != 0)
                {
                    SetVehicleToRespawn(carid);
                }
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                SmugglerWork[playerid] = 0;
                DisablePlayerCheckpoint(playerid);
            }
            if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0)
               {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            if(IsPlayerInAnyVehicle(playerid) && !engineOn[GetPlayerVehicleID(playerid)] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130 || GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154)
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            else if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,1481.0206,-1771.1138,18.7958);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 999;
            }
            else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563))
            {
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
            }
            else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472))
            {
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
            }
            else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313))
            {
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
            }
            else if(NoFuel[playerid] == 1)
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                NoFuel[playerid] = 0;
            }
        }
        return 1;
    }

Server-ul are host sau il ti din pc ? Ca s-ar putea sa fie de la lag .

  • Upvote 1
Link to comment
Share on other sites

  • 1

 

SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;

Este tot acolo,uitate dupa entrance,

​Nu ma intereseaza asta, ma intereseaza cand apesi sa iesi din afacere.

  • Upvote 1
Link to comment
Share on other sites

  • 0

SetPlayerPos(playerid,BizzInfo[bExitX],BizzInfo[bExitY],BizzInfo[bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;

Este tot acolo,uitate dupa entrance,

Link to comment
Share on other sites

  • 0

Da.

if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
                    {
                        SetPlayerVirtualWorld(playerid, i);
                          SetPlayerInterior(playerid,HouseInfo[i][hInt]);
                        SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
                        GameTextForPlayer(playerid, "~w~Bun venit acasa", 5000, 1);
                        PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
                        PlayerInfo[playerid][pLocal] = i+500;
                        return 1;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~INCHIS", 5000, 1);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(BizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
                {
                    //printf("Found House :%d",i);
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(BizzInfo[i][bLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~INCHIS", 5000, 1);
                                return 1;
                            }
                            if(i == 6 || i == 7 || i == 8)
                            {
                                OnPlayerEnterFood(playerid, 3)
                                SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 25)
                            {
                                OnPlayerEnterFood(playerid, 2)
                                SetPlayerInterior(playerid,BizzInfo[25][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[25][bExitX],BizzInfo[25][bExitY],BizzInfo[25][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[25][bInterior];
                                PlayerInfo[playerid][pLocal] = 25+99;
                                SetPlayerVirtualWorld(playerid, 25+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 2)
                            {
                                OnPlayerEnterFood(playerid, 1)
                                SetPlayerInterior(playerid,BizzInfo[2][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[2][bExitX],BizzInfo[2][bExitY],BizzInfo[2][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[2][bInterior];
                                PlayerInfo[playerid][pLocal] = 2+99;
                                SetPlayerVirtualWorld(playerid, 2+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                            }
                            if(i == 24)
                            {
                                SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                return 1;
                            }
                            if(i == 5 || i == 14 || i == 15 || i == 9 || i == 10 || i == 11 || i == 12 || i == 13 || i == 16 || i == 17 || i == 19 || i == 20 || i == 21 || i == 22 || i == 23)
                            {
                                SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                            }
                            SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
                            format(string, sizeof(string), "~r~-$%d~n~~w~scrie /exit~n~pentru a iesi", BizzInfo[i][bEntranceCost]);
                            BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
                            OnPropUpdate();
                            GameTextForPlayer(playerid, string, 5000, 3);
                        }
                        if(i == 6 || i == 7 || i == 8)
                        {
                                OnPlayerEnterFood(playerid, 3)
                                SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 25)
                        {
                                OnPlayerEnterFood(playerid, 2)
                                SetPlayerInterior(playerid,BizzInfo[25][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[25][bExitX],BizzInfo[25][bExitY],BizzInfo[25][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[25][bInterior];
                                PlayerInfo[playerid][pLocal] = 25+99;
                                SetPlayerVirtualWorld(playerid, 25+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 2)
                        {
                                OnPlayerEnterFood(playerid, 1)
                                SetPlayerInterior(playerid,BizzInfo[2][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[2][bExitX],BizzInfo[2][bExitY],BizzInfo[2][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[2][bInterior];
                                PlayerInfo[playerid][pLocal] = 2+99;
                                SetPlayerVirtualWorld(playerid, 2+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        if(i == 5 || i == 14 || i == 15 || i == 9 || i == 10 || i == 11 || i == 12 || i == 13 || i == 16 || i == 17 || i == 19 || i == 20 || i == 21 || i == 22 || i == 23 || i == 24)
                        {
                                SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                                SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                                PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
                                PlayerInfo[playerid][pLocal] = i+99;
                                SetPlayerVirtualWorld(playerid, i+99);
                                format(string, sizeof(string), "Scrie /exit~n~pentru a iesi");
                                GameTextForPlayer(playerid, string, 5000, 3);
                                OnPropUpdate();
                                return 1;
                        }
                        SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
                        SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
                        PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
                        PlayerInfo[playerid][pLocal] = i+99;
                        SetPlayerVirtualWorld(playerid, i+99);
                        new dood[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, dood, sizeof(dood));
                        format(string, sizeof(string), "%s a platit $%d pentru a intra la %d", dood, BizzInfo[i][bEntranceCost], i);
                        printf("%s", string);
                        PayLog(string);
                        //PlayerInfo[playerid][pLocal] = i;
                        return 1;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Nu ai bani", 5000, 1);
                        return 1;
                    }
                }
            }
            for(new i = 0; i < sizeof(SBizzInfo); i++)
            {
                if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
                {
                    if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
                    {
                        if(PlayerInfo[playerid][pPbiskey] != i)
                        {
                            if(SBizzInfo[i][sbLocked] == 1)
                            {
                                GameTextForPlayer(playerid, "~r~Inchis", 5000, 1);
                                return 1;
                            }
                            SafeGivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
                            gSpentCash[playerid] = GetPlayerMoney(playerid);
                            SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
                            new dood[MAX_PLAYER_NAME];
                            GetPlayerName(playerid, dood, sizeof(dood));
                            format(string, sizeof(string), "%s a platit $%d pentru a intra la %d", dood, SBizzInfo[i][sbEntranceCost], i);
                            printf("%s", string);
                            PayLog(string);
                            OnPropUpdate();
                            return 1;
                        }
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Nu ai bani", 5000, 1);
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Si exit,poate aveti nevoie.
if(strcmp(cmd, "/exit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i <  sizeof(HouseInfo); i++)
            {
                //printf("House :%d",i);
                if (PlayerToPoint(1.5, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) && GetPlayerVirtualWorld(playerid) == i)
                {
                    if(GetPlayerVirtualWorld(playerid) == i)
                    {
                                SetPlayerInterior(playerid, 0);
                            SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
                            PlayerInfo[playerid][pInt] = 0;
                            PlayerInfo[playerid][pLocal] = 999;
                            SetCameraBehindPlayer(playerid);
                            SetPlayerVirtualWorld(playerid,0);
                            if(HouseInfo[i][hHel] == 1 && HouseInfo[i][hArm] == 1)
                            {
                                SetPlayerHealth(playerid,99.0);
                                SetPlayerArmour(playerid,99.0);
                                return 1;
                            }
                            if(HouseInfo[i][hHel] == 1)
                            {
                                SetPlayerHealth(playerid,100.0);
                                return 1;
                            }
                            if(HouseInfo[i][hArm] == 1)
                            {
                                SetPlayerArmour(playerid,99.0);
                                return 1;
                            }
                    }
                }
            }
            for(new i = 0; i <  sizeof(BizzInfo); i++)
            {
                //printf("Bizz :%d",i);
                if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
                {
                    if(GetPlayerVirtualWorld(playerid) == i+99)
                    {
                        SetPlayerInterior(playerid,0);
                        PlayerInfo[playerid][pInt] = 0;
                        SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
                        PlayerInfo[playerid][pLocal] = 999;
                        SetPlayerVirtualWorld(playerid, 0);
                        OnPlayerExitFood(playerid)
                    }
                }
            }
            new carid = GetPlayerVehicleID(playerid);
            if (IsABus(carid))
            {
                TogglePlayerControllable(playerid, 1);
                //GangZoneHideForPlayer(playerid, buszoneeast);
                //GangZoneHideForPlayer(playerid, buszonewest);
                RemovePlayerFromVehicle(playerid);
                if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, carid);
            }
            if (IsASweeper(carid))
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            if(IsAHarvest(carid))
            {
                if (carid != 0)
                {
                    SetVehicleToRespawn(carid);
                }
                if(FarmerPickup[playerid][0] >= 1 && FarmerPickup[playerid][0] <= 22)
                {
                    FarmerPickup[playerid][0]--;
                }
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                FarmerVar[playerid] = 0;
                DisablePlayerRaceCheckpoint(playerid);
            }
            if(IsADrugHarvest(carid))
            {
                if (carid != 0)
                {
                    SetVehicleToRespawn(carid);
                }
                if(DrugFarmerPickup[playerid][0] >= 1 && DrugFarmerPickup[playerid][0] <= 37)
                {
                    DrugFarmerPickup[playerid][0]--;
                }
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                DrugFarmerVar[playerid] = 0;
                DisablePlayerCheckpoint(playerid);
            }
            if(IsASmuggleCar(carid))
            {
                if(carid != 0)
                {
                    SetVehicleToRespawn(carid);
                }
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                SmugglerWork[playerid] = 0;
                DisablePlayerCheckpoint(playerid);
            }
            if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0)
               {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            if(IsPlayerInAnyVehicle(playerid) && !engineOn[GetPlayerVehicleID(playerid)] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130 || GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154)
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
            }
            else if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
            {
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,1481.0206,-1771.1138,18.7958);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 999;
            }
            else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563))
            {
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
            }
            else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472))
            {
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
            }
            else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313))
            {
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
            }
            else if(NoFuel[playerid] == 1)
            {
                TogglePlayerControllable(playerid, 1);
                RemovePlayerFromVehicle(playerid);
                NoFuel[playerid] = 0;
            }
        }
        return 1;
    }
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.