22.03.2018, 06:27
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:
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:
And, finally, OnPlayerTeleported:
Hope that is helpful.
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
Код:
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); }
Код:
forward OnPlayerTeleported(playerid); public OnPlayerTeleported(playerid) { TogglePlayerControllable(playerid, 1); }