+MUTATOR_HOOKFUNCTION(ctf, ClientConnect)
+{
+ if(!autocvar_g_ctf_leaderboard)
+ return;
+
+ entity player = M_ARGV(0, entity);
+
+ if(IS_REAL_CLIENT(player))
+ {
+ for(int i = 1; i <= RANKINGS_CNT; ++i)
+ {
+ race_SendRankings(i, 0, 0, MSG_ONE);
+ }
+ }
+}
+
+MUTATOR_HOOKFUNCTION(ctf, GetPressedKeys)
+{
+ if(!autocvar_g_ctf_leaderboard)
+ return;
+
+ entity player = M_ARGV(0, entity);
+
+ if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1)
+ {
+ if (!player.stored_netname)
+ player.stored_netname = strzone(uid2name(player.crypto_idfp));
+ if(player.stored_netname != player.netname)
+ {
+ db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
+ strunzone(player.stored_netname);
+ player.stored_netname = strzone(player.netname);
+ }
+ }
+}
+