Author: grimsk8ter11
Difficulty: 1/5
:: SERVER SIDE ::In frmServer, add:
Code:
Private Sub Form_Load()
ShutOn = False
End Sub
Replace the tmrShutdown_Timer sub with:
Code:
Private Sub tmrShutdown_Timer()
Static Secs As Long
If ShutOn = False Then
Secs = 30
Call TextAdd(frmServer.txtText, "Automated Server Shutdown Canceled!", True)
Call GlobalMsg("Server Shutdown Canceled!", BrightBlue)
tmrShutdown.Enabled = False
Exit Sub
End If
If Secs <= 0 Then Secs = 30
Secs = Secs - 1
Call GlobalMsg("Server Shutdown in " & Secs & " seconds.", BrightBlue)
Call TextAdd(frmServer.txtText, "Automated Server Shutdown in " & Secs & " seconds.", True)
If Secs <= 0 Then
tmrShutdown.Enabled = False
Call DestroyServer
End If
End Sub
Replace Sub mnuShutdown_Click() with:
Code:
Private Sub mnuShutdown_Click()
If ShutOn = False Then
tmrShutdown.Enabled = True
mnuShutdown.Caption = "Cancel Shutdown"
ShutOn = True
ElseIf ShutOn = True Then
mnuShutdown.Caption = "Shutdown"
ShutOn = False
End If
End Sub
In the properties of tmrShutdown change the interval to 1000 and
set enabled to false.
In modtypes, under:
Code:
Option Explicit
Add:
Code:
Public ShutOn As Boolean
That's all!