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

Allow Only One Client


Alerd
 Share

Recommended Posts

Add this into modGameLogic:

```

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
```

Add this on top of Sub Main():

```

Call MultiClient
```

Add this sub into modGameLogic:

```

Sub MultiClient()
Dim GameClient As Long
Dim OldAppName As String
OldAppName = App.Title
App.Title = ""
GameClient = FindWindow(vbNullString, OldAppName)
App.Title = OldAppName
If App.PrevInstance = True Or GameClient <> 0 Then
Call MsgBox("Client already running!", vbExclamation, "Error")
End
End If
End Sub
```
Link to comment
Share on other sites

intresting,but it would have draw backs in the users view. some people enjoy loging more then 1 char.xD

nice code tho some one may use it. ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

EDIT:```

Call MultiClient

```
on top of Sub Main(). You add it just under/ in it.

(as that's sort of confusing)

EDIT: I get the error saying my client is already running even if it isn't.

Could some one explain this tutorial better?

I've tried a few different things to make it work and I can't wrap my head around it I guess.

Has any one gotten it to work?
Link to comment
Share on other sites

  • 2 months later...
Works for me fine. Thank you ! These little things are important for a good game !

EDIT:

> EDIT: I get the error saying my client is already running even if it isn't.

Copy&Paste as stated above, compile, close VB Project.

As long as your VB Project is opened it will tell you that you already have one client opened ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)
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...