2021-02-26, 04:24 AM
(2021-02-26, 02:22 AM)Z3fRaN Wrote: more like top 5 killers of all time, i'm using yini so..
There is no need for loops. All you need is already there for you to use:
https://open.mp/docs/scripting/callbacks...Disconnect
https://open.mp/docs/scripting/callbacks/OnPlayerDeath
You make an enum that holds top5 players information (player names, number of kills, maybe time when they moved up in the top and so on...). On?OnPlayerDeath callback you just make the checks if the player has more kills than top5 player or top4 player and so on. On that callback you do the checks and would be a good idea to save the top list after the top changes. Of course you will need to use Y_INI to load the top5 on OnGameModeInit also.