#include <sourcemod>
#include <sdktools>
#define PLUGIN_AUTHOR "tuty,Runner"
#define PLUGIN_VERSION "1.1"
#pragma semicolon 1
public Plugin:myinfo =
{
name = "Resetscore",
author = PLUGIN_AUTHOR,
description = "Type !resetscore in chat to reset your score.",
version = PLUGIN_VERSION,
url = "www.sourcemod.net"
};
public OnPluginStart()
{
RegConsoleCmd( "say", CommandSay );
RegConsoleCmd( "say_team", CommandSay );
}
public Action:CommandSay( id, args )
{
if(!id || !IsClientInGame(id))
return Plugin_Continue;
decl String:Said[ 128 ];
GetCmdArgString( Said, sizeof( Said ) - 1 );
StripQuotes( Said );
TrimString( Said );
if( id && StrEqual( Said, "!rs" ) || StrEqual( Said, "!resetscore" ) || StrEqual( Said, "!rdk" )
|| StrEqual( Said, "!кы" ) || StrEqual( Said, "!куыуеысщку" ) || StrEqual( Said, "!квл" )
|| StrEqual( Said, "!сброс" ) || StrEqual( Said, "!сброс счета" ) )
{
if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
{
PrintToChat( id, "\x03[SM Resetscore] \x01Ваш счёт и так \x04[0:0]" );
return Plugin_Continue;
}
SetClientFrags( id, 0 );
SetClientDeaths( id, 0 );
decl String:Name[ 32 ];
GetClientName( id, Name, sizeof( Name ) - 1 );
PrintToChat( id, "\x03[SM Resetscore] \x01Вы успешно обнулили свой счёт" );
PrintToChatAll( "\x03[SM Resetscore] \x04%s \x01обнулил свой счёт.", Name );
}
return Plugin_Continue;
}
stock SetClientFrags( index, frags )
{
SetEntProp( index, Prop_Data, "m_iFrags", frags );
return 1;
}
stock SetClientDeaths( index, deaths )
{
SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
return 1;
}