Tracking Players Using Maps
4. Tracking Players Using Maps
You're going to use a map to track the number of eliminations a player has scored. Maps provide a handy association of keys to values, and in this tutorial, youll use the player as the key and their associated weapon tier (represented as an int) as the value. That way, you can retrieve a players current tier given just a reference to the player. An example of how a map of player-to-weapon tier associations might look is provided below.
You're going to use a map to track the number of eliminations a player has scored. Maps provide a handy association of keys to values, and in this tutorial, you’ll use the player as the key and their associated weapon tier (represented as an int) as the value. That way, you can retrieve a player’s current tier given just a reference to the player. An example of how a map of player-to-weapon tier associations might look is provided below.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.