Code:
#include <amxmodx>
#include <cstrike>
#if !defined CSI_AWP
#error "This plugin requires AMXX 1.9 or a newer version."
#endif
const MAX_AWPS_PER_TEAM = 3
const MIN_PLAYERS = 10
new g_iAWPCount[CsTeams]
public plugin_init()
{
register_plugin("Max AWPs Per Team", "1.1", "OciXCrom")
register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start")
}
public OnRoundStart()
{
g_iAWPCount[CS_TEAM_CT] = 0
g_iAWPCount[CS_TEAM_T] = 0
}
public CS_OnBuy(id, iItem)
{
if(iItem == CSI_AWP)
{
if(get_playersnum() < MIN_PLAYERS)
{
client_print(id, print_center, "You cannot purchase an AWP when there are less than %i players in the server.", MIN_PLAYERS)
return PLUGIN_HANDLED
}
new CsTeams:iTeam = cs_get_user_team(id)
if(g_iAWPCount[iTeam] == MAX_AWPS_PER_TEAM)
{
client_print(id, print_center, "Your team cannot purchase more than %i AWPs per round.", MAX_AWPS_PER_TEAM)
return PLUGIN_HANDLED
}
g_iAWPCount[iTeam]++
}
return PLUGIN_CONTINUE
}
__________________