DayZ 1.29
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 строка 1690

1691 {
1692 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(PersistentFlag.AREA_PRESENCE) )
1693 {
1694 //simulation time is bellow a threshold, which means the player has recently connected,
1695 //the player does not have the AREA_PRESENCE flag set, which means they were not inside the area when they disconnected,
1696 //that means they just spawned into a contaminated area, lets move them somewhere safe
1697 vector player_pos = player.GetPosition();
1698 vector closest_safe_pos = MiscGameplayFunctions.GetClosestSafePos(player_pos, safe_positions);
1699
1700 if (player_pos!=closest_safe_pos)
1701 {
1702 closest_safe_pos[1] = g_Game.SurfaceY(closest_safe_pos[0], closest_safe_pos[2]);
1703
1704 player.SetPosition( closest_safe_pos );//...so lets teleport them somewhere safe
1705 //DeveloperTeleport.SetPlayerPosition(player, closest_safe_pos);
1706 g_Game.RPCSingleParam(player, ERPCs.RPC_WARNING_TELEPORT, null, true, player.GetIdentity());
1707
1708 PluginAdminLog adminLog = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
1709 if (adminLog)
1710 adminLog.PlayerTeleportedLog(player,player_pos,closest_safe_pos,"Unwillingly spawning in contaminated area.");
1711 }
1712
1713 player.SetPersistentFlag(PersistentFlag.AREA_PRESENCE, false);
1714 }
1715 }
DayZGame g_Game
Определения DayZGame.c:3942
ERPCs
Определения ERPCs.c:2
PersistentFlag
Определения PersistentFlag.c:6
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:325
Определения EnConvert.c:119

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