Что-то я запутался, сложно. Не могу понять, что именно убрать из плагина.
Попробуй.
#include <sourcemod> #include <sdktools> static killcount[MAXPLAYERS+1]; static Handle:hCount = INVALID_HANDLE; static bool:NoDoubleEventFire; public OnPluginStart() { HookEvent("infected_death", hGiveAwp); HookEvent("round_start", RoundStartEvent); hCount = CreateConVar("l4d2_specialammo_killcountsetting", "5", "How much Infected a Player has to shoot to win special ammo. (default 120) ", FCVAR_NONE); AutoExecConfig(true, "l4d2_specialammo"); // an autoexec! ooooh shiny } public Action:RoundStartEvent(Handle:event, const String:name[], bool:dontBroadcast) { for (new i = 1; i <= MaxClients; i++) { killcount[i] = 0; } } public OnClientDisconnect(client) { killcount[client] = 0; } public OnClientPostAdminCheck(client) { killcount[client] = 0; } public Action:hGiveAwp(Handle:event, String:ename[], bool:dontBroadcast) { if (NoDoubleEventFire) return Plugin_Continue; new client = GetClientOfUserId(GetEventInt(event, "attacker")); new bool:minigun = GetEventBool(event, "minigun"); new bool:blast = GetEventBool(event, "blast"); if (client) { if (!minigun && !blast) killcount[client] += 1; else { NoDoubleEventFire = false; return Plugin_Continue; } if ((killcount[client] > GetConVarInt(hCount))) { if(IsClientInGame(client) && GetClientTeam(client) == 2) { killcount[client] = 0; GiveFunction(client, "sniper_awp"); } } } NoDoubleEventFire = false; return Plugin_Continue; } void GiveFunction(int client, char[] name) { char sBuf[32]; int flags = GetCommandFlags("give"); SetCommandFlags("give", flags & ~FCVAR_CHEAT); FormatEx(sBuf, sizeof sBuf, "give %s", name); FakeClientCommand(client, sBuf); }