Interior change problem
#1

I was making a city hall so i made a CP outside a building in SF and it teleports them to city hall. after when the 1 second timer finishes they get tped back outside SF City Hall. How i fix this?
I want to use the yellow marker to exit and that works good
Example

*Tanush goes inside the Checkpoint outside SF building
*Tanush teleports there and been frozen 1 second and unfreezed
*Tanush takes one step and it auto teleports him outside the SF building

Onplayerinteriorchange
pawn Код:
if(insfhall[playerid] == 1)
    {
        insfhall[playerid] = 0;
        SetTimerEx("SFhall",2000,0,"i",playerid);
    }
OnplayerenterdynamicCP
pawn Код:
else if(checkpointid == cityhallout)
    {
        SetTimerEx("Obj",1000,0,"i",playerid);
        TogglePlayerControllable(playerid,0);
        SetPlayerInterior(playerid,3);
        SetPlayerVirtualWorld(playerid,1);
        SetPlayerFacingAngle(playerid,98.0517);
        SetCameraBehindPlayer(playerid);
        SetPlayerPos(playerid,387.0217,173.8155,1008.382);
    }
The settimerex("obj..
pawn Код:
SendClientMessage(playerid,lightyellow,"You been frozen for 1 seconds because the objects were loading, you are free to move now");
    TogglePlayerControllable(playerid,1);
Reply
#2

bump
Reply
#3

thank
Reply
#4

Do you also have exit point in the place you're placing the players? That could cause the exit code to be instantly executed when teleported inside, and to be teleported outside.
Reply
#5

sorry i dont get what you mean?
Reply
#6

As you use CP, you can use the OnPlayerEnterCheckpoint callback instead of a timer. Also you can have something like a cooldown after entering/exiting from somewhere. So you can have a var like this one. Each time you enter/exit somewhere change it to 5 and then each second reduce it by 1. Only if its equal to 0 let him enter.

Example:
pawn Код:
OnOneSecondTimer(playerid)
{
    if (EnterExitCoolDown[playerid] > 0) EnterExitCoolDown[playerid] --;
    if (EnterExitCoolDown[playerid] == 0)
    {
        //your position check
        if PLAYER_AT_ENTER_POINT
        {
            Teleport_Him
            EnterExitCoolDown[playerid] = 5;
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)