Author Topic: Number of Games Played  (Read 317 times)

0 Members and 1 Guest are viewing this topic.

Offline Ratman

  • Major(1)
  • Posts: 15
Number of Games Played
« on: March 19, 2017, 07:33:15 pm »
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!

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1003
  • The world isn't nice. Why should I be...?
Re: Number of Games Played
« Reply #1 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?

Offline Ratman

  • Major(1)
  • Posts: 15
Re: Number of Games Played
« Reply #2 on: March 20, 2017, 09:12:45 pm »
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?


Sorry I dont think I follow.. do you have any examples perhaps?

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1003
  • The world isn't nice. Why should I be...?
Re: Number of Games Played
« Reply #3 on: March 22, 2017, 06:09:04 pm »
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?
Sorry I dont think I follow.. do you have any examples perhaps?
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 minute
Cannot you do something like that?