#pragma semicolon 1
#include <morecolors>
#pragma newdecls required
#include <cstrike>
bool
bCSGO,
bEnable;
public Plugin myinfo =
{
name = "ResetScore",
version = "1.1",
description = "Обнуление счета (убийств и смертей) игроков",
author = "tuty, babka68",
url = "http://tmb-css.ru https://hlmod.ru"
}
public void OnPluginStart()
{
bCSGO = GetEngineVersion() == Engine_CSGO;
RegConsoleCmd("say", CommandSay);
RegConsoleCmd("say_team", CommandSay);
ConVar cvar = CreateConVar("sm_resetscore", "1", "1 - включает, 0 - отключает плагин.", _, true, _, true, 1.0);
cvar.AddChangeHook(CVarChange);
bEnable = cvar.BoolValue;
}
public void CVarChange(ConVar cvar, const char[] oldValue, const char[] newValue)
{
bEnable = cvar.BoolValue;
}
public Action CommandSay(int client, int args)
{
if(!client) return Plugin_Continue;
static char buffer[MAX_NAME_LENGTH];
GetCmdArgString(buffer, sizeof(buffer));
StripQuotes(buffer);
TrimString(buffer);
if(strcmp(buffer, "!rs") && strcmp(buffer, "!кы") && strcmp(buffer, "!resetscore") && strcmp(buffer, "!куыуесщку"))
return Plugin_Continue;
if(!bEnable)
{
CPrintToChat(client, "{lime}[ResetScore] {fullred}Плагин отключен!");
return Plugin_Handled;
}
if(!GetClientDeaths(client) && !GetClientFrags(client))
{
CPrintToChat(client, "{lime}[ResetScore] {white}Ваш счет и так равен {fullred}0{white}!");
return Plugin_Handled;
}
SetEntProp(client, Prop_Data, "m_iFrags", 0);
SetEntProp(client, Prop_Data, "m_iDeaths", 0);
CS_SetMVPCount(client, 0);
if(bCSGO)
{
CS_SetClientAssists(client, 0);
CS_SetClientContributionScore(client, 0);
}
CPrintToChat(client, "{lime}[ResetScore] {white}Вы успешно сбросили счет!");
GetClientName(client, buffer, sizeof(buffer));
for(int i = 1; i <= MaxClients; i++) if(i != client && IsClientInGame(i) && !IsFakeClient(i))
CPrintToChat(i, "{lime}[ResetScore] {fullred}%s {white}сбросил свой счет!", buffer);
return Plugin_Handled;
}