checks if we should teleport the player to a safe location and if so, performs the teleportation
1685 {
1686 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(
PersistentFlag.AREA_PRESENCE) )
1687 {
1688
1689
1690
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 );
1699
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
1708 }
1709 }
PluginBase GetPlugin(typename plugin_type)
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
proto native CGame GetGame()