Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Logout to MainMenu


mh1701
 Share

Recommended Posts

ok…..  you (the reader) are about to ready my first Souce Code Tut EVER!

here it goes........

This tutoral will show you how to make your game client go from 'closing when you log off' to 'returning to the Main Menu when you log off'

STEP ONE:  Open VB and go into 'modGameLogic
STEP TWO: Find the line that says "Call GameDestroy"
                Change it to "Call GameLogout"
STEP THREE: Locate the Sub "Sub GameDestroy"
                  And the end of this sub under "End Sub" put in this.......

Sub Gamelogout()
    ' Unloads all TCP-related things.
    Call TcpDestroy

    ' Unloads all DirectX objects.
    Call DestroyDirectX

    ' Unloads the BGM in memory (soon-to-be obsolete).
    Call StopBGM

    ' Closes the VB6 application.
    'End
    ' Returns to Main Menu
    frmMirage.Hide
    Load frmMainMenu
    frmMainMenu.Show
    frmMainMenu.SetFocus
    frmSendGetData.Hide
End Sub

DONE!
I hope this helped some of ya!
Please leave any comments or edits to this code if you have any.
Link to comment
Share on other sites

or, to simplify that block of code, this would also work…..

Sub Gamelogout()
    Call TcpDestroy
    Call DestroyDirectX
    Call StopBGM
    frmMirage.Hide
    Load frmMainMenu
    frmMainMenu.Show
    frmMainMenu.SetFocus
    frmSendGetData.Hide
End Sub
Link to comment
Share on other sites

good lol but put it in code and also to work on would be nice if when you clicked logout a message box comes up with two buttons one saying "main menu" and the other saying "charecter select" other then that this is great
Link to comment
Share on other sites

  • 3 months later...
Yeah, I'm experiencing the same problem as Ridrik, also. It lets you do everything else but exit the game by clicking on the Quit button.

EDIT: Also, after you return to the main menu, it says that the server is offline for a few seconds, which displays the incorrect news message.
Link to comment
Share on other sites

to switch characters you can just add this to the button
```
Call SwitchCharacter
```
```
Sub SwitchCharacter()
InGame = False
GettingMap = True
InEditor = False
InSpellEditor = False
InSpawnEditor = False
Running = False
frmMirage.Socket.Close
frmMirage.picExitOptions.Visible = False
frmMirage.Visible = False
frmChars.Visible = true
```
that s not exactly but pretty much what i did (there are some lines you don't really need in there)
Link to comment
Share on other sites

  • 1 year later...
~~I think I messed up somehow, so I removed the script/code, so then when im fixing up by testing the client, the log out button doesnt work, it just stays there.

Can you like, give me the original code pretty please? =P~~

I'll just rip it outta a diffrent download of stable.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...