DayZ 1.27
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 строка 1677

1678 {
1679 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(PersistentFlag.AREA_PRESENCE) )
1680 {
1681 //simulation time is bellow a threshold, which means the player has recently connected,
1682 //the player does not have the AREA_PRESENCE flag set, which means they were not inside the area when they disconnected,
1683 //that means they just spawned into a contaminated area, lets move them somewhere safe
1684 vector player_pos = player.GetPosition();
1685 vector closest_safe_pos = MiscGameplayFunctions.GetClosestSafePos(player_pos, safe_positions);
1686
1687 if (player_pos!=closest_safe_pos)
1688 {
1689 closest_safe_pos[1] = GetGame().SurfaceY(closest_safe_pos[0], closest_safe_pos[2]);
1690
1691 player.SetPosition( closest_safe_pos );//...so lets teleport them somewhere safe
1692 //DeveloperTeleport.SetPlayerPosition(player, closest_safe_pos);
1693 GetGame().RPCSingleParam(player, ERPCs.RPC_WARNING_TELEPORT, null, true, player.GetIdentity());
1694
1695 PluginAdminLog adminLog = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
1696 if (adminLog)
1697 adminLog.PlayerTeleportedLog(player,player_pos,closest_safe_pos,"Unwillingly spawning in contaminated area.");
1698 }
1699
1700 player.SetPersistentFlag(PersistentFlag.AREA_PRESENCE, false);
1701 }
1702 }
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().