I am trying to record the amount of rounds played. It is currently increasing by two instead of one. What could the problem be?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Test"
new iRound[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("TeamScore", "teamScore", "a");
register_clcmd("say /round","showRound");
}
public teamScore()
{
//Increase Rounds Played for All Players
for(new i = 1; i <= get_maxplayers(); i++)
{
if(is_user_connected(i))
{
if (!(cs_get_user_team(i) == CS_TEAM_SPECTATOR))
{
iRound[i]++;
}
}
}
}
public showRound(id)
{
client_print(id, print_chat, "You have played %i rounds", iRound[id]);
}