10.05.2015, 08:07
Hey there! So I've been thinking of creating a system with the top players which would get number of kills from each player and sort it so everyone on the server can see who's the best.
I'm not little bit more familiar with MySQL so I wanted to do something like this. There would be 'TopPlayers' table which would have two fields for now: Name and KillCount. When someone enters a command '/topplayers', they get a dialog with top players which was previously formatted so I don't have to run a query each time someone enters the command. I could maybe add a loop which would run every hour to update the list of the best players.
But I have to ask which way would be better: when a player kills someone, the table gets updated with the current kill count, or when the player leaves the server, the table gets updated. The second way would maybe be better so the table doesn't get updated each second, which could maybe reduce lag?
Feel free to tell me what do you guys think.
I'm not little bit more familiar with MySQL so I wanted to do something like this. There would be 'TopPlayers' table which would have two fields for now: Name and KillCount. When someone enters a command '/topplayers', they get a dialog with top players which was previously formatted so I don't have to run a query each time someone enters the command. I could maybe add a loop which would run every hour to update the list of the best players.
But I have to ask which way would be better: when a player kills someone, the table gets updated with the current kill count, or when the player leaves the server, the table gets updated. The second way would maybe be better so the table doesn't get updated each second, which could maybe reduce lag?
Feel free to tell me what do you guys think.