DayZ 1.28
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 строка 1684

1685 {
1686 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(PersistentFlag.AREA_PRESENCE) )
1687 {
1688 //simulation time is bellow a threshold, which means the player has recently connected,
1689 //the player does not have the AREA_PRESENCE flag set, which means they were not inside the area when they disconnected,
1690 //that means they just spawned into a contaminated area, lets move them somewhere safe
1691 vector player_pos = player.GetPosition();
1692 vector closest_safe_pos = MiscGameplayFunctions.GetClosestSafePos(player_pos, safe_positions);
1693
1694 if (player_pos!=closest_safe_pos)
1695 {
1696 closest_safe_pos[1] = GetGame().SurfaceY(closest_safe_pos[0], closest_safe_pos[2]);
1697
1698 player.SetPosition( closest_safe_pos );//...so lets teleport them somewhere safe
1699 //DeveloperTeleport.SetPlayerPosition(player, closest_safe_pos);
1700 GetGame().RPCSingleParam(player, ERPCs.RPC_WARNING_TELEPORT, null, true, player.GetIdentity());
1701
1702 PluginAdminLog adminLog = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
1703 if (adminLog)
1704 adminLog.PlayerTeleportedLog(player,player_pos,closest_safe_pos,"Unwillingly spawning in contaminated area.");
1705 }
1706
1707 player.SetPersistentFlag(PersistentFlag.AREA_PRESENCE, false);
1708 }
1709 }
ERPCs
Определения ERPCs.c:2
PersistentFlag
Определения PersistentFlag.c:6
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
proto native float SurfaceY(float x, float z)
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Определения EnConvert.c:106
proto native CGame GetGame()

Перекрестные ссылки GetGame(), GetPlugin(), CGame::RPCSingleParam() и CGame::SurfaceY().