Won't enter houses
#1

Ok, It lets me enter everything else accept houses.

pawn Код:
COMMAND:enter(playerid, params[])
{
    new string[128], carid = GetPlayerVehicleID(playerid);
    if(GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
    if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead !");
    if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently muted !");
    for(new i = 0; i < MAX_HOUSES;i++)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0,jHInfo[i][hEnterPointX], jHInfo[i][hEnterPointY], jHInfo[i][hEnterPointZ]))
        {
            if(GetPlayerVirtualWorld(playerid) == jHInfo[i][hVW] && GetPlayerInterior(playerid) == jHInfo[i][hInt])
            {
                if(jHInfo[i][hLocked] == 0)
                {
                    if(jHInfo[i][hOwned] == 0) return SendClientMessage(playerid, COLOR_GREY, "You can't enter a un-owned property.");
                    PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
                    Streamer_UpdateEx(playerid, jHInfo[i][hIntX], jHInfo[i][hIntY], jHInfo[i][hIntZ], jHInfo[i][hInt]);
                    SetPlayerPos(playerid,jHInfo[i][hIntX], jHInfo[i][hIntY], jHInfo[i][hIntZ]);
                    SetPlayerInterior(playerid,jHInfo[i][hInt]);
                    LoadAreaPl(playerid, 1, i);
                    SetPlayerVirtualWorld(playerid,jHInfo[i][hVW]);
                    SetTimerEx("Streamer_Update", 300, false, "i", playerid);
                    SetPVarInt(playerid, "HouseEnter", i), SetPVarInt(playerid, "BizzEnter", 1000), SetPVarInt(playerid, "IntEnter", 1000);
                }
                else SendClientMessage(playerid,COLOR_LIGHTRED,"House is locked.");
            }
        }
    }
    for(new b = 0; b < sizeof(BizzInfo); b++)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0,BizzInfo[b][bEnterX],BizzInfo[b][bEnterY],BizzInfo[b][bEnterZ]))
        {
            if(BizzInfo[b][bLock] == 0)
            {
                if(strcmp(PlayerName(playerid), BizzInfo[b][bOwner], true) == 0)
                {
                    //PrintBizzSafe(playerid,b);
                }
                else
                {
                    if(BizzInfo[b][bFee] > 0 && GetPVarInt(playerid, "Member") != 7 && GetPVarInt(playerid, "Duty") == 0)
                    {
                        if(GetPlayerMoneyEx(playerid) >= BizzInfo[b][bFee])
                        {
                            format(string, sizeof(string),"~r~-$%d", BizzInfo[b][bFee]);
                            if(GetPVarInt(playerid, "ConnectTime") >= 8) GameTextForPlayer(playerid, string, 5000, 1), GivePlayerMoneyEx(playerid,-BizzInfo[b][bFee]), BizzInfo[b][bMoney]+=BizzInfo[b][bFee];
                        }
                        else return SendEnough(playerid,"dollars", BizzInfo[b][bFee], GetPlayerMoneyEx(playerid));
                    }
                }
                PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
                Streamer_UpdateEx(playerid, BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ], BizzInfo[b][bInterior]);
                if(BizzInfo[b][bFreeze] == 1) TogglePlayerControllableEx(playerid, false);
                SetTimerEx("Streamer_Update", 350, false, "i", playerid);
                SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
                SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
                SetPlayerVirtualWorld(playerid,b+200);
                LoadAreaPl(playerid, 3, b);
                SetPVarInt(playerid, "BizzEnter", b), SetPVarInt(playerid, "HouseEnter", 1000), SetPVarInt(playerid, "IntEnter", 1000);
                PlayAudioStreamForPlayerEx(playerid, "open-door.mp3");
                if(BizzInfo[b][bFreeze] == 0) SetTimerEx("LoadChecks", 1500, false, "i", playerid);
                if(BizzInfo[b][bFreeze] == 1) SetTimerEx("TogglePlayerControllableEx", 3000, false, "ii", playerid, true);
            }
            else SendClientMessage(playerid,COLOR_LIGHTRED,"Business is locked.");
        }
    }
    for(new b = 0; b < sizeof(IntInfo); b++)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0,IntInfo[b][iEnterX],IntInfo[b][iEnterY],IntInfo[b][iEnterZ]))
        {
            switch(IntInfo[b][iType])
            {
                case 5:
                {
                    if(GetPVarInt(playerid, "Member") != 2 && GetPVarInt(playerid, "Member") != 7)
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this building.");
                        return 1;
                    }
                }
                case 40:
                {
                    if(GetPVarInt(playerid, "Member"))
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this building.");
                        return 1;
                    }
                }
                case 9:
                {
                    if(GetPlayerMoneyEx(playerid) >= 1000)
                    {
                        GivePlayerMoneyEx(playerid,-1000);
                        return SetVehiclePos(GetPlayerVehicleID(playerid),IntInfo[b][iExitX],IntInfo[b][iExitY],IntInfo[b][iExitZ]);
                    }
                    else return SendClientMessage(playerid,COLOR_GREY,"You need $1000 to get in here.");
                }
                case 20:
                {
                    if(GetPVarInt(playerid, "Member") != 2 && GetPVarInt(playerid, "Member") != 7)
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this building.");
                        return 1;
                    }
                    else return SetVehiclePos(GetPlayerVehicleID(playerid),IntInfo[b][iExitX],IntInfo[b][iExitY],IntInfo[b][iExitZ]);
                }
                case 35:
                {
                    if(GetPVarInt(playerid, "Member") != 4)
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this building.");
                        return 1;
                    }
                }
            }
            if(ClosingTimes(b))
            {
                format(string, sizeof(string),"The %s is currently closed, opening hours start from 6:00 to 0:00.", IntInfo[b][iName]);
                SendClientMessage(playerid, COLOR_WHITE, string);
                return 1;
            }
            if(GetPVarInt(playerid, "Drag") != 501 && IsPlayerConnected(GetPVarInt(playerid, "Drag")))
            {
                new targetid = GetPVarInt(targetid, "Drag");
                SetPVarInt(targetid, "IntEnter", b), SetPVarInt(targetid, "BizzEnter", 1000), SetPVarInt(targetid, "HouseEnter", 1000);
            }
            SetPVarInt(playerid, "IntEnter", b), SetPVarInt(playerid, "BizzEnter", 1000), SetPVarInt(playerid, "HouseEnter", 1000);
            Streamer_UpdateEx(playerid, IntInfo[b][iExitX],IntInfo[b][iExitY],IntInfo[b][iExitZ], IntInfo[b][iInt]);
            if(IntInfo[b][iFreeze] == 1) TogglePlayerControllableEx(playerid, false);
            SetPlayerPos(playerid,IntInfo[b][iExitX],IntInfo[b][iExitY],IntInfo[b][iExitZ]);
            SetPlayerInterior(playerid,IntInfo[b][iInt]);
            SetPlayerVirtualWorld(playerid,IntInfo[b][iWorld]);
            LoadAreaPl(playerid, 2, b);
            PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~w~Type /exit to leave.", 3000, 4);
            PlayAudioStreamForPlayerEx(playerid, "open-door.mp3");
            if(IntInfo[b][iFreeze] == 0) SetTimerEx("LoadChecks", 1500, false, "i", playerid);
            if(IntInfo[b][iFreeze] == 1) SetTimerEx("TogglePlayerControllableEx", 3000, false, "ii", playerid, true);
        }
    }
    for(new h = 0; h < sizeof(FactionInfo); h++)
    {
        if(h >= 8)
        {
            if(IsPlayerInRangeOfPoint(playerid,3.0,FactionInfo[h][fExit][0],FactionInfo[h][fExit][1],FactionInfo[h][fExit][2]))
            {
                if(FactionInfo[h][fInterior] == 0) return SendClientMessage(playerid,COLOR_LIGHTRED,"This faction HQ's interior is under construction.");
                if(FactionInfo[h][fLocked] == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"This faction HQ is locked.");
                PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
                if(FactionInfo[h][fFrozen] == 1)
                {
                    TogglePlayerControllableEx(playerid, false);
                    SetTimerEx("Streamer_Update", 350, false, "i", playerid);
                }
                SetPlayerPos(playerid,FactionInfo[h][fSpawn][0],FactionInfo[h][fSpawn][1],FactionInfo[h][fSpawn][2]);
                SetPlayerInterior(playerid,FactionInfo[h][fInterior]);
                SetPlayerVirtualWorld(playerid,h);
                PlayAudioStreamForPlayerEx(playerid, "open-door.mp3");
                if(GetPVarInt(playerid,"Member") == h) ShowSafeInfo(playerid,GetPVarInt(playerid,"Member"));
                LoadAreaPl(playerid, 4, 0);
                if(FactionInfo[h][fFrozen] == 1) SetTimerEx("TogglePlayerControllableEx", 3000, false, "ii", playerid, true);
            }
            if(IsPlayerInRangeOfPoint(playerid,2.0,FactionInfo[h][fFact][0], FactionInfo[h][fFact][1], FactionInfo[h][fFact][2]))
            {
                if(GetPVarInt(playerid,"Member") != h) return true;
                if(FactionInfo[GetPVarInt(playerid, "Member")][fWep] == 0 && FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] == 0) return true;
                if(GetPVarInt(playerid, "FactPerm") == 0) return 1;
                if(FactionInfo[GetPVarInt(playerid, "Member")][fDrugs] >= 1 && GetPVarInt(playerid, "Rank") <= 2) return 1;
                PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
                SetPlayerPos(playerid,963.418762,2108.292480,1011.030273);
                SetPlayerInterior(playerid, 1);
                SetPlayerVirtualWorld(playerid,h);
                GameTextForPlayer(playerid, "~w~Type /exit to leave.", 3000, 4);
                SetPVarInt(playerid, "Checkpoint", CHECKPOINT_NONE);
                SetPlayerCheckpoint(playerid,941.0215,2163.6846,1011.0303,2.0);
                LoadAreaPl(playerid, 4, 0);
            }
        }
    }
    for(new h = 0; h < sizeof(PaintSprays); h++)
    {
        if(IsPlayerInRangeOfPoint(playerid,5.0,PaintSprays[h][0],PaintSprays[h][1],PaintSprays[h][2]))
        {
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "You must be in a vehicle to use this !");
            if(GetPlayerMoneyEx(playerid) >= 1000)
            {
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),playerid);
                foreach (Player,i)
                {
                    if(GetPlayerVehicleID(i) == carid)
                    {
                        SetPlayerVirtualWorld(i,playerid);
                    }
                }
                SetPVarInt(playerid, "ColorUse", 0);
                if(GetPVarInt(playerid,"Member") == 7) SetPVarInt(playerid, "ColorUse", 2);
                if(GetPVarInt(playerid,"DonateRank") >= 1) SetPVarInt(playerid, "ColorUse", 2);
                TogglePlayerControllable(playerid,false);
                SetVehiclePos(GetPlayerVehicleID(playerid),PaintSprays[h][3],PaintSprays[h][4],PaintSprays[h][5]);
                SetPVarInt(playerid, "PaintID", h);
                SetTimerEx("OnPaintSpray", 4000, false, "i", playerid);
            }
            else SendClientMessage(playerid,COLOR_GREY,"You need $1000 to use this.");
        }
    }
    if(GetPlayerInterior(playerid) == 1)
    {
        if(GetPlayerVirtualWorld(playerid) == 1 || GetPlayerVirtualWorld(playerid) == 2)
        {
            if(IsPlayerInRangeOfPoint(playerid,1.0,2491.7153,-1034.1152,3104.8589))
            {
                Streamer_UpdateEx(playerid, 2281.8086,-1290.4663,3125.9863, GetPlayerInterior(playerid));
                TogglePlayerControllableEx(playerid, false);
                SetTimerEx("TogglePlayerControllableEx", 5000, false, "ii", playerid, true);
                PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
                SetPlayerPos(playerid,2281.8086,-1290.4663,3125.9863+2.0);
                GameTextForPlayer(playerid, "~w~Type /exit to leave.", 3000, 4);
                LoadAreaPl(playerid, 4, 0);
            }
        }
    }
    if(IsAtBathroom(playerid))
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X,Y,Z);
        SetPVarFloat(playerid,"BathX",X), SetPVarFloat(playerid,"BathY",Y), SetPVarFloat(playerid,"BathZ",Z);
        SetPlayerPos(playerid, 1976.3580,3822.8984,120.3078);
        SetPlayerFacingAngle(playerid, 291.2172);
        PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
        LoadAreaPl(playerid, 4, 0);
    }
    return 1;
}
Reply
#2

What does it say when you try? If nothing, then the house enter coord variable isn't working.
Reply
#3

Do the houses have different virtual world to 0? If so, it could also be that you're checking if the player virtual world is the same as the house too before allowing entry (with no else error message).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)