checks if we should teleport the player to a safe location and if so, performs the teleportation
1678 {
1679 if( player.GetSimulationTimeStamp() < 20 && !player.IsPersistentFlag(
PersistentFlag.AREA_PRESENCE) )
1680 {
1681
1682
1683
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 );
1692
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
1701 }
1702 }
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()