Download

Indexing Each Player with a Number

Hello. I am trying to create a for each event ran on the server for all of the connected players in a session to be assigned an individual number in the PlayerInfo Structure. For example, Player 1 would be assigned 1, player 2 would be assigned 2, etc. Can someone please send me an example of this loop? Thank you.

Does something like this help you?

image_200762.png

Player Array should be a list of connected clients, not sure what your Playerinfo Struct looks like but you should be able to use this loop to get the number of connected players through this.

https://docs.unrealengine.com/en-US/…ode/index.html
https://docs.unrealengine.com/en-US/…ate/index.html

So something like this? I don’t think it’s working. I’m trying to index each player by assigning them a value in order to make it easier in to call certain players.

Is this local multiplayer or online?

Online multiplayer through steam. If I can have an event run on server that indexs each player and adds it to their playerinfo struct, I can call from that struct (eg. spawn all players with indexes 1-4 somewhere and 5-8 somewhere else.)

I am a noob and this is how I give players numbers :d

1, On the gamemode:

](filedata/fetch?id=1804211&d=1598245530)
2. On the player character BP