Raised This Month: $51 Target: $400
 12% 

[RQ] modified plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 01-30-2016 , 07:14   [RQ] modified plugin
Reply With Quote #1

Hello,

I use this plugin to reset score for my csgo server, but has a small bug does not reset the kill assist score.

Can someone help me with changing it please ?

Thank You!


Code:
#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 = "Type !resetscore in chat to reset your score.",
	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, "!rs" ) || StrEqual( Said, "!restartscore" ) )
	{
		if( GetConVarInt( gPluginEnabled ) == 0 )
		{
			PrintToChat( id, "\x03[SM Resetscore] The plugin is disabled." );
			PrintToConsole( id, "[SM Resetscore] You can't use this command when plugin is disabled!" );
		
			return Plugin_Continue;
		}
	
		if( !IsPlayerAlive( id ) )
		{
			PrintToChat( id, "\x03[SM Resetscore] You can't use this command while you are dead." );
			PrintToConsole( id, "[SM Resetscore] Only alive players can use this command." );
		
			return Plugin_Continue;
		}

		if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
		{
			PrintToChat( id, "\x03[SM Resetscore] Your score is already 0!" );
			PrintToConsole( id, "[SM Resetscore] You can't reset your score right now." );
			
			return Plugin_Continue;
		}
				
		SetClientFrags( id, 0 );
		SetClientDeaths( id, 0 );
	
		decl String:Name[ 32 ];
		GetClientName( id, Name, sizeof( Name ) - 1 );
	
		PrintToChat( id, "\x03[SM Resetscore] You have successfully reseted your score!" );
		PrintToChatAll( "\x03[SM Resetscore] %s has just reseted his score.", Name );
		PrintToConsole( id, "[SM Resetscore] You have successfully reseted your score." );
	}
	
	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;
}
cristi_ip is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode