DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TeleportCheck()

static void TeleportCheck ( notnull PlayerBase player,
notnull array< ref array< float > > safe_positions )
staticprotected

checks if we should teleport the player to a safe location and if so, performs the teleportation

См. определение в файле MiscGameplayFunctions.c строка 1823

1824 {
1825 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(PersistentFlag.AREA_PRESENCE) )
1826 {
1827 //simulation time is bellow a threshold, which means the player has recently connected,
1828 //the player does not have the AREA_PRESENCE flag set, which means they were not inside the area when they disconnected,
1829 //that means they just spawned into a contaminated area, lets move them somewhere safe
1830 vector player_pos = player.GetPosition();
1831 vector closest_safe_pos = MiscGameplayFunctions.GetClosestSafePos(player_pos, safe_positions);
1832
1833 if (player_pos!=closest_safe_pos)
1834 {
1835 closest_safe_pos[1] = g_Game.SurfaceY(closest_safe_pos[0], closest_safe_pos[2]);
1836
1837 player.SetPosition( closest_safe_pos );//...so lets teleport them somewhere safe
1838 //DeveloperTeleport.SetPlayerPosition(player, closest_safe_pos);
1839 g_Game.RPCSingleParam(player, ERPCs.RPC_WARNING_TELEPORT, null, true, player.GetIdentity());
1840
1841 PluginAdminLog adminLog = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
1842 if (adminLog)
1843 adminLog.PlayerTeleportedLog(player,player_pos,closest_safe_pos,"Unwillingly spawning in contaminated area.");
1844 }
1845
1846 player.SetPersistentFlag(PersistentFlag.AREA_PRESENCE, false);
1847 }
1848 }
DayZGame g_Game
Определения DayZGame.c:4074
ERPCs
Определения ERPCs.c:2
PersistentFlag
Определения PersistentFlag.c:6
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:326
Определения EnConvert.c:119

Перекрестные ссылки g_Game и GetPlugin().