Not tested
PHP Code:
#define PLUGIN_NAME "Restricție AWP"
#define PLUGIN_AUTHOR "xSaG.exe"
#define PLUGIN_DESCRIPTION "Restricție la awp īn funcție de jucători."
#define PLUGIN_VERSION "1.0"
#define PLUGIN_URL "https://steamcommunity.com/id/xsag69"
#include <sourcemod>
#include <sdktools>
int iAWP;
public Plugin:myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = PLUGIN_URL
};
public OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
iAWP = 0;
}
public Action CS_OnBuyCommand(int client, const char[] weapon)
{
int CheckTeam = GetClientTeam(client);
if(strcmp(weapon,"awp", false) == 0 && (CheckTeam == 2 || CheckTeam == 3))
{
float RatieAwpT = float((33 / 100) * GetTeamClientCount(2));
float RatieAwpCT = float((33 / 100) * GetTeamClientCount(3));
if(RatieAwpT > iAWP || RatieAwpCT > iAWP)
{
PrintToChat(client, "Echipa ta are prea multe awp-uri!");
return Plugin_Handled;
}
iAWP++;
}
return Plugin_Continue;
}
Best Regard!