#include <sourcemod>
#include <sdktools>
#define PLUGIN_AUTHOR "Lecter"
#define PLUGIN_VERSION "1.2"
#pragma semicolon 1
new Handle:gPluginEnabled = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "Resetscore (privat massage)",
author = PLUGIN_AUTHOR,
description = "This is plugin is reset your score",
version = PLUGIN_VERSION,
url = "http://trapserver.ru"
};
public OnPluginStart()
{
RegConsoleCmd( "say", CommandSay );
RegConsoleCmd( "say_team", CommandSay );
gPluginEnabled = CreateConVar( "sm_resetscore", "1" );
CreateConVar( "resetscore_version", PLUGIN_VERSION, "Reset Score", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
}
public Action:CommandSay( id, args )
{
decl String:Said[ 128 ];
GetCmdArgString( Said, sizeof( Said ) - 1 );
StripQuotes( Said );
TrimString( Said );
if( StrEqual( Said, "!rs" ) || StrEqual( Said, "!restartscore" ) || StrEqual( Said, "!Rs" ) || StrEqual( Said, "!rS" ) || StrEqual( Said, "!RS" ) || StrEqual( Said, "!КЫ" ) || StrEqual( Said, "!кы" ) || StrEqual( Said, "!Кы" ) || StrEqual( Said, "!кЫ" ) || StrEqual( Said, "!resetcore" ) )
{
if( GetConVarInt( gPluginEnabled ) == 0 )
{
PrintToChat( id, "\x04[Обнуление счета] \x03Плагин отключен!" );
return Plugin_Handled;
}
if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
{
PrintToChat( id, "\x04[Обнуление счета] \x03Ваш счет и так равен\x01 0 \x03!" );
return Plugin_Handled;
}
SetClientFrags( id, 0 );
SetClientDeaths( id, 0 );
decl String:Name[ 32 ];
GetClientName( id, Name, sizeof( Name ) - 1 );
PrintToChat( id, "\x04[Обнуление счета] \x03Ваш счет сброшен!" );
return Plugin_Handled;
}
return Plugin_Continue;
}
SetClientFrags( index, frags )
{
SetEntProp( index, Prop_Data, "m_iFrags", frags );
return 1;
}
SetClientDeaths( index, deaths )
{
SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
return 1;
}