Freeze() public method

Freezes this player (prevents from moving, building, and from using most commands). Throws PlayerOpException on problems.
public Freeze ( [ player, bool announce, bool raiseEvents ) : void
player [ Player who is doing the freezing.
announce bool Whether to announce freezing publicly on the server.
raiseEvents bool Whether to raise PlayerInfo.FreezeChanging and PlayerInfo.FreezeChanged events.
return void
Beispiel #1
0
 // freeze target if player is allowed to do so
 static void FreezeIfAllowed( Player player, PlayerInfo targetInfo ) {
     if( targetInfo.IsOnline && !targetInfo.IsFrozen && player.Can( Permission.Freeze, targetInfo.Rank ) ) {
         try {
             targetInfo.Freeze( player, true, true );
             player.Message( "Player {0}&S has been frozen while you retry.", targetInfo.ClassyName );
         } catch( PlayerOpException ) { }
     }
 }