Print Page | Close Window

Server Shutdown

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=133
Printed Date: 20 December 2006 at 5:52pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Server Shutdown
Posted By: Sync
Subject: Server Shutdown
Date Posted: 11 February 2006 at 2:41pm
Difficulty: Easy 2/5

Originaly Posted By: Dragoons Master

I make a nice add to server shut down system

ONLY SERVER SIDE:


on frmServer add:

Private Sub Form_Load()
    ShutOn = False
End Sub

replace the hole sub:

Private Sub tmrShutdown_Timer()

with:

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

and Private Sub mnuShutdown_Click() , with:

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 the tmrShutdown change the interval to 1000 and make sure enable is false

in modtypes, under:

Option Explicit

add:

Public ShutOn As Boolean

Have fun, =D



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info