[Race]How to get Player Position in Race (example: 3rd/10)
#3

- You need a variabele for the checkpoints to begin with (new PlayerRCP[MAX_PLAYERS]),
- and a variabele to check if the player is in the race (new InRace[MAX_PLAYERS])

- With each checkpoint the player reaches, increment the PlayerRCP with 1.
- Set up a looping timer on race start to a function called (for example) UpdateRacePos().
- Create your new public.
- Make it loop trough all players in the race.
- Sort out the positions by PlayerRCP.
- If two or more players are at the same CP, check who is closest to the next CP (PlayerToPoint)

Something like that. Not simple though ...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)