| Mirage Source http://www.miragesource.net/forums/ |
|
| Server Shutdown http://www.miragesource.net/forums/viewtopic.php?f=210&t=83 |
Page 1 of 1 |
| Author: | Tutorial Bot [ Thu Jun 01, 2006 10:24 pm ] |
| Post subject: | Server Shutdown |
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! |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|