if(!g_ca && !g_arena) { game_starttime += RESTART_COUNTDOWN; }
// clear alivetime
- FOR_EACH_CLIENTP(tmp_player)
+ FOR_EACH_CLIENT(tmp_player)
{
tmp_player.alivetime = 0;
- PlayerStats_Event(p, PLAYERSTATS_ALIVETIME, -PlayerStats_Event(p, PLAYERSTATS_ALIVETIME));
+ PlayerStats_Event(tmp_player, PLAYERSTATS_ALIVETIME, -PlayerStats_Event(tmp_player, PLAYERSTATS_ALIVETIME, 0));
}
restart_mapalreadyrestarted = 0; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
}
}
-void PlayerStats_Event(entity e, string event_id, float value)
+float PlayerStats_Event(entity e, string event_id, float value)
{
if((e.playerstats_id == "") || playerstats_db < 0)
- return;
+ return 0;
string key;
float val;
val = stof(db_get(playerstats_db, key));
val += value;
db_put(playerstats_db, key, ftos(val));
+ return val;
}
void PlayerStats_TeamScore(float t, string event_id, float value) // TODO: doesn't this remain unused?
void PlayerStats_AddEvent(string event_id);
// call on each event to track, or at player disconnect OR match end for "global stuff"
-void PlayerStats_Event(entity e, string event_id, float value);
+float PlayerStats_Event(entity e, string event_id, float value);
// add a team score
void PlayerStats_TeamScore(float t, string event_id, float value);