#include <sourcemod>
#include <sdktools>
#define PLUGIN_AUTHOR "tuty"
#define PLUGIN_VERSION "1.1"
#pragma semicolon 1
new Handle:gPluginEnabled = INVALID_HANDLE;
public Plugin:myinfo =
{
name = "Resetscore",
author = PLUGIN_AUTHOR,
description = "Lenullazza a jatekost statjat.",
version = PLUGIN_VERSION,
url = "www.ligs.us"
};
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, "!resetscore" ) || StrEqual( Said, "!restartscore" ) )
{
if( GetConVarInt( gPluginEnabled ) == 0 )
{
PrintToChat( id, "\x03[Resetscore] A Plugin Kikapcsolva." );
PrintToConsole( id, "[Resetscore] Nem hasznalhatja ezt a parancsot ha a plugin ki van kapcsolva." );
return Plugin_Continue;
}
if( !IsPlayerAlive( id ) )
{
PrintToChat( id, "\x03[Resetscore] Nem lehet hasznalni ezt a parancsot, amig meghalt." );
PrintToConsole( id, "[Resetscore] Csak elo jatekosok hasznalhatjak ezt a parancsot." );
return Plugin_Continue;
}
if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
{
PrintToChat( id, "\x03[Resetscore] A Statod mar 0!" );
PrintToConsole( id, "[Resetscore] Nem lehet visszaallitani a pontszamot." );
return Plugin_Continue;
}
SetClientFrags( id, 0 );
SetClientDeaths( id, 0 );
decl String:Name[ 32 ];
GetClientName( id, Name, sizeof( Name ) - 1 );
PrintToChat( id, "\x03[Resetscore] Sikeresen nullaztad a statisztikadat!" );
PrintToChatAll( "\x03[Resetscore] %s Nullazta a Statisztikajat!", Name );
PrintToConsole( id, "[Resetscore] Sikeresen nullaztad a statisztikadat!" );
}
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;
}