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

Logout button :D


Tridia Online
 Share

Recommended Posts

I searched and did not see any status on it so I decided to create one, let go to it.

Work only in the Client

1 Go and create a PictureBox frmMain and set the amount of Visible = false and named : picAlert.

2 ° Within of the PictureBox and create two CommandButton named: one cmdLogout and the other  cmdCancel.

3: Double click on the button cmdCancel and put this:

Private Sub cmdCancel_Click()
    If Not picCharacter.Visible Then
        picCharacter.Visible = True
        picAlert.Visible = False
    End If
End Sub

In a 4 ° Double click cmdCancel and put this:

If Map.Moral = 1 Then
        logoutGame
        Else
        AddText "You cannot logout into the battle zone!", BrightRed
        picCharacter.Visible = True
        picAlert.Visible = False
    End If

Go 5 ° in frmMain code and find:

Cancel = True
    logoutGame

put this in place:

Cancel = True
    picAlert.Visible = True

This makes the player click the [x] to close the window you see a warning window for logging or cancel (Note: The player can only log in safe zone.)

I hope this helps.

Sorry my bad English
Link to comment
Share on other sites

@lexkymbeth:

> i suggest using code tags

Code tags don't communicate well with the VB6 IDE; they space the sections of code out by tabs instead of newlines. They only really work with a language(s) like C/C++/C#/Java; anything that basically closes a line of code with some sort of character (e.g. ';', etc.).
Link to comment
Share on other sites

@Robin:

> You press the button and you go back to the main menu. Why would you need a screenshot for that?

We need a like button for replys. Cause I would like this.

About the button. Yeah I guess it could be useful. It's fairly easy to do though. I'm no programmer but I think I would have been able to figure this out by my own.
Link to comment
Share on other sites

  • 4 weeks later...
This button requires a few edits to work properly.

```
Private Sub cmdCancel_Click()
    If Not picCharacter.Visible Then
        picCharacter.Visible = True
        picAlert.Visible = False
    End If
End Sub
```
delete the If Not code and End If, and the piccharacter.visible = true part. They are unneeded.

and please, just change this:
```
If Map.Moral = 1 Then
        logoutGame
        Else
        AddText "You cannot logout into the battle zone!", BrightRed
        picCharacter.Visible = True
        picAlert.Visible = False
    End If
```
to this:

```
If Map.Moral = 1 Then
        picAlert.Visible = False
        logoutGame
        Else
        AddText "You cannot logout in a PvP area!", BrightRed
        picAlert.Visible = False
    End If

```
If you don't, this box will not close when you logout, so if you relog in, it will be there still. Also, you don't need picCharacter to be visible.
d Sub
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 1 month later...

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...