View Single Post
jesusaliso
Member
Join Date: Aug 2013
Location: Venezuela
Old 09-11-2023 , 10:56   Re: Searching Plugins, i can't found
Reply With Quote #3

Quote:
Originally Posted by Siska1 View Post
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
}
Thank you very kind, if you know of any other complement I will be pending. Can you add me on discord?
jesusaliso is offline
Send a message via Skype™ to jesusaliso