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

[VB6] How to loop through all players


erkro1
 Share

Recommended Posts

> This might be a stupid question but I can't figure out how to loop through all players, For i = 1 to MAX_PLAYERS doesn't work because it only loops through all online players.
>
> So does someone knows how to do that?

MAX_PLAYERS will work. But 1 to Player_HighIndex wont work, becouse it is loop between online players only. But if you wanna use some variable from offline player, you must use Call LoadPlayer(index,name)
Link to comment
Share on other sites

If you mean all the player files, you'll need to open up and load every single one of them separately and change what you need in them. Eclipse only loads in data when the user logs in under the default behavior.

The following piece of code might be useful in this case..

```

strLoad = dir(App.path & "\Data\Accounts\" & "*.*")

Do While strLoad > vbNullString

' Do stuff here

' Keep this at the bottom, it resets it to the next file.

strLoad = dir

Loop

```

strLoad would be the account filename in this piece of code.
Link to comment
Share on other sites

charlist.txt is the first useless remnant I remove every time I work on the engine, so I never suggest people to use it. (Not to mention, you'd still be looping through a list just like the code above, so in the end it makes no difference)
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...