Server Talk > Scripting Discussions and Help
Number of Games Played
(1/1)
Ratman:
Hello I am new to scripting and stuck at a spot.
I was wondering how I could keep track of the number of games or amount of time played by each player. The function or procedure would have to count every game/time while playing ctf no matter the team (except if hes specing) and the number would update at the end of each game (or continually if counting time).
I was thinking of using onplayerjoin but cant seem to find a way to keep tracking the time or games for each player.
Thank you!
machina:
I don't make scripts in Soldat but can't you use a cron-like solution that would fetch a list of players every e.g. 30 seconds?
Ratman:
--- Quote from: machina on March 20, 2017, 11:07:44 am ---I don't make scripts in Soldat but can't you use a cron-like solution that would fetch a list of players every e.g. 30 seconds?
--- End quote ---
Sorry I dont think I follow.. do you have any examples perhaps?
machina:
--- Quote from: Ratman on March 20, 2017, 09:12:45 pm ---
--- Quote from: machina on March 20, 2017, 11:07:44 am ---I don't make scripts in Soldat but can't you use a cron-like solution that would fetch a list of players every e.g. 30 seconds?
--- End quote ---
Sorry I dont think I follow.. do you have any examples perhaps?
--- End quote ---
Well, I'm sure it is possible to fetch a list of players at any time.
* Get a list of players currently playing
* Update the data stored in the database about time played by each player by increasing the value by 1 minute
* Reapeat every 1 minuteCannot you do something like that?
Navigation
[0] Message Index
Go to full version