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

See how the number of players on a map?


tidus133
 Share

Recommended Posts

No need to make 3 topics for one question. You can edit your first post or make a new post in the same topic explaining what you want, don't just keep making new topics.

You can also edit the title of your topic by doing a full edit on the first post, so again no need to make a new topic.

Now, about the actual question… Abhi's code wont work straight out as it's an example and not a full code, so you'd have to edit to to fit what you needed.

To get the count of players on the map, inside the square brackets comparing to max players that could be on the map, you would do this...

```

Dim playersOnMap As Byte

Dim textOnMap As String

For i = 1 To Player_HighIndex

If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then

playersOnMap = playersOnMap + 1

End If

Next

textOnMap = "[" & playersOnMap & "/" & MAX_PLAYERS & "]"

```

Then depending on what version of Eclipse your using, you would render the TextOnMap string to your screen whenever you wanted it drawn.
Link to comment
Share on other sites

> So what's the best way to get these values from another map (for example, see how many players there is in Map.Right)?

You could use the same code I posted and only have to change one part.

This would show you how many players are on the map south of you…

```

For i = 1 To Player_HighIndex

If IsPlaying(i) And GetPlayerMap(i) = Map.Down Then

playersOnMap = playersOnMap + 1

End If

Next

textOnMap = "[" & playersOnMap & "/" & MAX_PLAYERS & "]"

```

Then just look at the line```

If IsPlaying(i) And GetPlayerMap(i) = Map.Down Then

```and change Map.Down to Map.Left, Map.Right or Map.Up depending on which map you want the count to be for.
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...