goto and gethere
#5

In case you use dynamic objects from Streamer Plugin (as far as I understand, since you can't fall through original interiors even if an interior or vw is set wrong) you might want to freeze the player for the time being, letting the objects load. I had this problem a lot, so I came up with this:

Let's say you teleport someone somewhere, so upon teleportation, you have to freeze him:
Код:
TogglePlayerControllable(playerid, 0);
SetLoadObjectsTimer(playerid);//And also set the timer for unfreezing
As for SetLoadObjectsTimer, I take the ping into consideration, making sure the player won't fall through even after the freeze. As of these unfreeze timers, they might not be accurate, and you should verify if they allow the required portion of the interior to stream in properly:

Код:
stock SetLoadObjectsTimer(playerid)
{
    new ping = GetPlayerPing(playerid);
	if(ping < 100) SetTimerEx("OnPlayerTeleported", 2000, false, "d", playerid);
	else if(ping < 150) SetTimerEx("OnPlayerTeleported", 3000, false, "d", playerid);
	else if(ping < 200) SetTimerEx("OnPlayerTeleported", 4000, false, "d", playerid);
	else SetTimerEx("OnPlayerTeleported", 5000, false, "d", playerid);
}
And, finally, OnPlayerTeleported:

Код:
forward OnPlayerTeleported(playerid);
public OnPlayerTeleported(playerid)
{
	TogglePlayerControllable(playerid, 1);
}
Hope that is helpful.
Reply


Messages In This Thread
goto and gethere - by EvgeniyHostel1992 - 21.03.2018, 16:27
Re: goto and gethere - by kovac - 21.03.2018, 16:56
Re: goto and gethere - by EvgeniyHostel1992 - 21.03.2018, 18:58
Re: goto and gethere - by kovac - 21.03.2018, 19:07
Re: goto and gethere - by Maxandmov - 22.03.2018, 06:27

Forum Jump:


Users browsing this thread: 1 Guest(s)