Interiors not loading quick enough/ fall through floor
#1

Interior loads like 1 second too late and I fall through the floor. Doesn't always make me fall through the floor though. Sometimes only half through it and sometimes it's ok. How can I prevent this?
Reply
#2

A timer. show your current code.
Reply
#3

Quote:
Originally Posted by Spydah
Посмотреть сообщение
A timer. show your current code.
Thanks bro here's my code. Still having a major brain fart over some over code for the past 8 hours my brain is a bit frazzled! x(

pawn Код:
if (newkeys & KEY_SECONDARY_ATTACK)
    {
        if(InModShop[playerid] == 1)
        {
            if (newkeys & KEY_SECONDARY_ATTACK) return 0;
            TogglePlayerControllable(playerid, 0);
        }
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            RemoveDriverFromVehicle(playerid);
            if(engine[GetPlayerVehicleID(playerid)] == 0)
            {
                RemoveDriverFromVehicle(playerid);
                if(PlayerInfo[playerid][pCarlic] == 0)
                {
                    SetPlayerDrunkLevel (playerid, 0);
                }
            }
        }
        if (PlayerToPoint(0.5, playerid,340.3497,169.3933,1019.9912))
        {
            SetPlayerPos(playerid, 340.2886,167.8946,1019.9912);
        }
        if (PlayerToPoint(0.5, playerid,340.2886,167.8946,1019.9912))
        {
            SetPlayerPos(playerid, 340.3497,169.3933,1019.9912);
        }
        //for(new i = 0; i < sizeof(BuildingInfo); i++)
        {
            if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]))
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    return 0;
                }
                SetPlayerInterior(playerid, BuildingInfo[i][ExitInterior]);
                SetPlayerPos(playerid, BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]);
                if(drink[playerid] == 1)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 23);
                }
                if(drink[playerid] == 2)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 20);
                }
                if(drink[playerid] == 3)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 22);
                }
                if(drink[playerid] == 4)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                }
            }
            else if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]))
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]);
                if(drink[playerid] == 1)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 23);
                }
                if(drink[playerid] == 2)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 20);
                }
                if(drink[playerid] == 3)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 22);
                }
                if(drink[playerid] == 4)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                }
            }
        }
        for(new i = 0; i < sizeof(BusinessInfo); i++)
        {
            if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]))
            {
                if(BusinessInfo[i][bOwned] == 0 && AdminDuty[playerid] == 0)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked Business~<~", 3000, 4);
                    return 1;
                }
                if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz1] != i)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
                    return 1;
                }
                if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz2] != i)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
                    return 1;
                }
                if(IsPlayerInAnyVehicle(playerid))
                {
                    return 0;
                }
                SetPlayerVirtualWorld(playerid, i);
                SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
                SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
                if(PlayerInfo[playerid][pBiz1] == i || PlayerInfo[playerid][pBiz2] == i && BusinessInfo[i][bLocked] == 1)
                {
                    if(GetPlayerVirtualWorld(playerid) == BusinessInfo[i][EnterWorld])
                    {
                        SetPlayerVirtualWorld(playerid, i);
                        SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
                        SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
                        if(drink[playerid] == 1)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 23);
                        }
                        if(drink[playerid] == 2)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 20);
                        }
                        if(drink[playerid] == 3)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 22);
                        }
                        if(drink[playerid] == 4)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                        }
                    }
                }
            }
            else if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]))
            {
                if(GetPlayerVirtualWorld(playerid) == i)
                {
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]);
                    if(drink[playerid] == 1)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 23);
                    }
                    if(drink[playerid] == 2)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 20);
                    }
                    if(drink[playerid] == 3)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 22);
                    }
                    if(drink[playerid] == 4)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                    }
                }
            }
        }
    }
Reply
#4

Could you please use it in [pawn] and "//" where you get teleported to the Interior?
Reply
#5

Quote:
Originally Posted by Spydah
Посмотреть сообщение
Could you please use it in [pawn] and "//" where you get teleported to the Interior?
Didn't know you could do that sorry
Reply
#6

pawn Код:
if (newkeys & KEY_SECONDARY_ATTACK)
    {
        if(InModShop[playerid] == 1)
        {
            if (newkeys & KEY_SECONDARY_ATTACK) return 0;
            TogglePlayerControllable(playerid, 0);
        }
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            RemoveDriverFromVehicle(playerid);
            if(engine[GetPlayerVehicleID(playerid)] == 0)
            {
                RemoveDriverFromVehicle(playerid);
                if(PlayerInfo[playerid][pCarlic] == 0)
                {
                    SetPlayerDrunkLevel (playerid, 0);
                }
            }
        }
        if (PlayerToPoint(0.5, playerid,340.3497,169.3933,1019.9912))
        {
            SetPlayerPos(playerid, 340.2886,167.8946,1019.9912);
        }
        if (PlayerToPoint(0.5, playerid,340.2886,167.8946,1019.9912))
        {
            SetPlayerPos(playerid, 340.3497,169.3933,1019.9912);
        }
        for(new i = 0; i < sizeof(BuildingInfo); i++)
        {
            if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]))
            TogglePlayerControlable(playerid,0);
            SetTimer("businessenter", 1000, false); //Timer.
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    return 0;
                }
                SetPlayerInterior(playerid, BuildingInfo[i][ExitInterior]);
                SetPlayerPos(playerid, BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]);
                if(drink[playerid] == 1)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 23);
                }
                if(drink[playerid] == 2)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 20);
                }
                if(drink[playerid] == 3)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 22);
                }
                if(drink[playerid] == 4)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                }
            }
            else if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]))
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]);
                if(drink[playerid] == 1)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 23);
                }
                if(drink[playerid] == 2)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 20);
                }
                if(drink[playerid] == 3)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 22);
                }
                if(drink[playerid] == 4)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                }
            }
        }
        for(new i = 0; i < sizeof(BusinessInfo); i++)
        {
            if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]))
            {
                if(BusinessInfo[i][bOwned] == 0 && AdminDuty[playerid] == 0)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked Business~<~", 3000, 4);
                    return 1;
                }
                if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz1] != i)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
                    return 1;
                }
                if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz2] != i)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
                    return 1;
                }
                if(IsPlayerInAnyVehicle(playerid))
                {
                    return 0;
                }
                SetPlayerVirtualWorld(playerid, i);
                SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
                SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
                if(PlayerInfo[playerid][pBiz1] == i || PlayerInfo[playerid][pBiz2] == i && BusinessInfo[i][bLocked] == 1)
                {
                    if(GetPlayerVirtualWorld(playerid) == BusinessInfo[i][EnterWorld])
                    {
                        SetPlayerVirtualWorld(playerid, i);
                        SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
                        SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
                        if(drink[playerid] == 1)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 23);
                        }
                        if(drink[playerid] == 2)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 20);
                        }
                        if(drink[playerid] == 3)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 22);
                        }
                        if(drink[playerid] == 4)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                        }
                    }
                }
            }
            else if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]))
            {
                if(GetPlayerVirtualWorld(playerid) == i)
                {
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]);
                    if(drink[playerid] == 1)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 23);
                    }
                    if(drink[playerid] == 2)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 20);
                    }
                    if(drink[playerid] == 3)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 22);
                    }
                    if(drink[playerid] == 4)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                    }
                }
            }
        }
    }
pawn Код:
forward businessenter(playerid);
pawn Код:
public businessenter(playerid)
{
TogglePlayerControlable(playerid,1);
return 1;
}
Read what I've done so far and try it out on your own
Try this.
Reply
#7

Quote:
Originally Posted by Spydah
Посмотреть сообщение
pawn Код:
if (newkeys & KEY_SECONDARY_ATTACK)
    {
        if(InModShop[playerid] == 1)
        {
            if (newkeys & KEY_SECONDARY_ATTACK) return 0;
            TogglePlayerControllable(playerid, 0);
        }
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            RemoveDriverFromVehicle(playerid);
            if(engine[GetPlayerVehicleID(playerid)] == 0)
            {
                RemoveDriverFromVehicle(playerid);
                if(PlayerInfo[playerid][pCarlic] == 0)
                {
                    SetPlayerDrunkLevel (playerid, 0);
                }
            }
        }
        if (PlayerToPoint(0.5, playerid,340.3497,169.3933,1019.9912))
        {
            SetPlayerPos(playerid, 340.2886,167.8946,1019.9912);
        }
        if (PlayerToPoint(0.5, playerid,340.2886,167.8946,1019.9912))
        {
            SetPlayerPos(playerid, 340.3497,169.3933,1019.9912);
        }
        for(new i = 0; i < sizeof(BuildingInfo); i++)
        {
            if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]))
            SetTimer("businessenter", 1000, false);
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    return 0;
                }
                SetPlayerInterior(playerid, BuildingInfo[i][ExitInterior]);
                SetPlayerPos(playerid, BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]);
                if(drink[playerid] == 1)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 23);
                }
                if(drink[playerid] == 2)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 20);
                }
                if(drink[playerid] == 3)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 22);
                }
                if(drink[playerid] == 4)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                }
            }
            else if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]))
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid, BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]);
                if(drink[playerid] == 1)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 23);
                }
                if(drink[playerid] == 2)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 20);
                }
                if(drink[playerid] == 3)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid, 22);
                }
                if(drink[playerid] == 4)
                {
                    SetPlayerSpecialAction(playerid, 0);
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                }
            }
        }
        for(new i = 0; i < sizeof(BusinessInfo); i++)
        {
            if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]))
            {
                if(BusinessInfo[i][bOwned] == 0 && AdminDuty[playerid] == 0)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked Business~<~", 3000, 4);
                    return 1;
                }
                if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz1] != i)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
                    return 1;
                }
                if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz2] != i)
                {
                    GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
                    return 1;
                }
                if(IsPlayerInAnyVehicle(playerid))
                {
                    return 0;
                }
                SetPlayerVirtualWorld(playerid, i);
                SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
                SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
                if(PlayerInfo[playerid][pBiz1] == i || PlayerInfo[playerid][pBiz2] == i && BusinessInfo[i][bLocked] == 1)
                {
                    if(GetPlayerVirtualWorld(playerid) == BusinessInfo[i][EnterWorld])
                    {
                        SetPlayerVirtualWorld(playerid, i);
                        SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
                        SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
                        if(drink[playerid] == 1)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 23);
                        }
                        if(drink[playerid] == 2)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 20);
                        }
                        if(drink[playerid] == 3)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid, 22);
                        }
                        if(drink[playerid] == 4)
                        {
                            SetPlayerSpecialAction(playerid, 0);
                            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                        }
                    }
                }
            }
            else if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]))
            {
                if(GetPlayerVirtualWorld(playerid) == i)
                {
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]);
                    if(drink[playerid] == 1)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 23);
                    }
                    if(drink[playerid] == 2)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 20);
                    }
                    if(drink[playerid] == 3)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid, 22);
                    }
                    if(drink[playerid] == 4)
                    {
                        SetPlayerSpecialAction(playerid, 0);
                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
                    }
                }
            }
        }
    }
pawn Код:
forward businessenter();
Try this.
Oh hey you wrote it for me lol, didn't expect you to do that lol. Did you write it for both? There is building enter/exit and also Business enter/exit too. I only see the timer you set on entering a building.

EDIT: Also doesn't this just set a timer and nothing else? What will that timer do?
Reply
#8

Look in the post where I stated the code, edited it in there coz i'm writing from my phone

I hope this will work, good luck
Reply
#9

Quote:
Originally Posted by Spydah
Посмотреть сообщение
Look in the post where I stated the code, edited it in there coz i'm writing from my phone

I hope this will work, good luck
Cheers man I'll check it out shortly just getting stuck back into my code now

I had a feeling it would be something like this. It's just the first time you wrote it you didn't include what the timer did so I was a bit confused. Now I see what you've suggested. I guess that'll do the job.

EDIT: I haven't written this yet but the code you put won't work mate. All you've done is set a timer when you go to enter the business. This timer will just simply alllow the player to move after 1 second. But there is nothing set to freeze the player in the first place.

I'm going to TogglePlayerControllabe(playerid, 0) on entering then after 2 seconds allow the player to move from the timer with TogglePlayerControllable(playerid, 1) - Thanks for your suggestion though I'm sure you just forget to put the first peace of code there aswell.

Also I think it needs to be SetTimerEx because it needs to be a timer for a specific player.
Reply
#10

Sorry all forgot about it, haha.

And not a problem, good luck with it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)