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

resetscore


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-07-2012 , 22:06   resetscore
Reply With Quote #1

Hi, guys! Can someone add HUD information, like when you type /rs you are informed that you have reset you score. Also to add a short sound that player should hear after resetting his score. Whould be cool. Thanks.
Attached Thumbnails
Click image for larger version

Name:	2012-04-08 05h00_40.jpg
Views:	260
Size:	87.3 KB
ID:	101756  
Attached Files
File Type: sma Get Plugin or Get Source (resetscore.sma - 686 views - 2.5 KB)
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-08-2012 , 03:20   Re: resetscore
Reply With Quote #2

PHP Code:
{
        
client_print(idprint_chat"You have just reset your score")
    } 
---->

PHP Code:
{
        
client_cmd(id"spk ^"fvox/blip^"")
        
set_hudmessage(0,127,2550.0100.9002.02.0)
        
show_hudmessage(id"You have just reset your score")
    } 
bazhenov93 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 04-08-2012 , 03:45   Re: resetscore
Reply With Quote #3

Quote:
Originally Posted by bazhenov93 View Post
PHP Code:
{
        
client_print(idprint_chat"You have just reset your score")
    } 
---->

PHP Code:
{
        
client_cmd(id"spk ^"fvox/blip^"")
        
set_hudmessage(0,127,2550.0100.9002.02.0)
        
show_hudmessage(id"You have just reset your score")
    } 
precache sound?
EpicMonkey is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-08-2012 , 03:52   Re: resetscore
Reply With Quote #4

Quote:
Originally Posted by EpicMonkey View Post
precache sound?
bazhenov93 is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-08-2012 , 04:34   Re: resetscore
Reply With Quote #5

Code:
/*
   This is a simple plugin I made that will just restart a players score
   making their deaths and kills set to 0, this is to help players out a
   little bit because they no longer have to reconnect or retry if they
   want their score to start over, they can just type a simple command
   
      ---------------------------------
       --------- MADE BY SILENTTT -----
        ------ MADE BY SILENTTT ------
         --  MADE BY SILENTTT -------
        ------ MADE BY SILENTTT ------
       --------- MADE BY SILENTTT -----
      ---------------------------------
*/

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define adtime	 600.0 //Default of 10 minuites

new pcvar_Advertise
new pcvar_Display

public plugin_init()
{
	register_plugin("Reset Score", "1.0", "Silenttt")
	
	//You may type /resetscore or /restartscore
	register_clcmd("say /resetscore", "reset_score")
	register_clcmd("say /restartscore", "reset_score")
	register_clcmd("say /rs", "reset_score")
	
	//This command by default will be set at 0
	//Change it to 1 in server.cfg if you want
	//A message to be shown to advertise this.
	pcvar_Advertise = register_cvar("sv_rsadvertise", "0")
	//This command by default is also 0
	//Change it to 1 in server.cfg if you want
	//It to show who reset their scores when they do it
	pcvar_Display = register_cvar("sv_rsdisplay", "0")
	
	if(get_cvar_num("sv_rsadvertise") == 1)
	{
		set_task(adtime, "advertise", _, _, _, "b")
	}
}

public reset_score(id)
{
	//These both NEED to be done twice, otherwise your frags wont
	//until the next round
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s has just reset his score", name)
	}
	else
	{
		client_cmd(id, "spk ^"fvox/blip^"")
        set_hudmessage(0,127,255, 0.010, 0.90, 0, 2.0, 2.0)
        show_hudmessage(id, "You have just reset your score")
	}
	return PLUGIN_HANDLED
}

public advertise()
{
	set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
	show_hudmessage(0, "By typing /rs you can restart your deaths and kills back to 0")
}

public client_putinserver(id)
{
	if(get_pcvar_num(pcvar_Advertise) == 1)
	{
		set_task(10.0, "connectmessage", id, _, _, "a", 1)
	}
}

public connectmessage(id)
{
	if(is_user_connected(id))
	{
	client_print(id, print_chat, "By typing /resetscore at any time during the game, you can reset your deaths and kills back to 0 (rather than reconnecting)")
	}
}
Attached Thumbnails
Click image for larger version

Name:	2012-04-08 11h28_37.jpg
Views:	178
Size:	58.7 KB
ID:	101766  
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-08-2012 , 04:43   Re: resetscore
Reply With Quote #6

I don't get any errors, download from here.
Attached Files
File Type: sma Get Plugin or Get Source (resetscore.sma - 638 views - 2.8 KB)
bazhenov93 is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-08-2012 , 04:47   Re: resetscore
Reply With Quote #7

Also I have this message
Attached Thumbnails
Click image for larger version

Name:	2012-04-08 11h44_36.jpg
Views:	173
Size:	7.1 KB
ID:	101768  
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-08-2012 , 04:48   Re: resetscore
Reply With Quote #8

Quote:
Originally Posted by TRUE RED View Post
Also I have this message
Steam, non-steam?
bazhenov93 is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-08-2012 , 05:16   Re: resetscore
Reply With Quote #9

I prefer Steam. And this error still exist.
Attached Thumbnails
Click image for larger version

Name:	2012-04-08 11h44_36.jpg
Views:	150
Size:	7.1 KB
ID:	101769  
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-08-2012 , 05:19   Re: resetscore
Reply With Quote #10

I don't get the " why " , because for me works fine.
bazhenov93 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 19:43.


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