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

Reset Score


Post New Thread Reply   
 
Thread Tools Display Modes
magnum357
New Member
Join Date: Feb 2010
Old 02-15-2010 , 13:50   Re: Reset Score
Reply With Quote #21

Can you post /Resetscore code ?
magnum357 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 02-15-2010 , 14:07   Re: Reset Score
Reply With Quote #22

PHP 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")
    
    
//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(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
    if(
get_pcvar_num(pcvar_Display) == 1)
    {
        new 
name[33]
        
get_user_name(idname32)
        
client_print(0print_chat"%s has just reset his score"name)
    }
    else
    {
        
client_print(idprint_chat"You have just reset your score")
    }
}

public 
advertise()
{
    
set_hudmessage(25500, -1.00.2000.212.0)
    
show_hudmessage(0"By typing /resetscore 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(idprint_chat"By typing /resetscore at any time during the game, you can reset your deaths and kills back to 0 (rather than reconnecting)")
    }

__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
VanLi_bRuSly*
Member
Join Date: Mar 2010
Old 03-20-2010 , 12:03   Re: Reset Score
Reply With Quote #23

We can not do instead resetscore reset?

I saw a server /reset was with.
VanLi_bRuSly* is offline
gogubeb
Junior Member
Join Date: Nov 2006
Old 05-19-2010 , 18:35   Re: Reset Score
Reply With Quote #24

hi all i get this error with this plugin:
Code:
L 10/23/2009 - 14:30:48: Info (map "de_dust2") (file  "addons/amxmodx/logs/error_20091023.log")
L 10/23/2009 - 14:30:48:  [CSTRIKE] Invalid player 13
L 10/23/2009 - 14:30:48: [AMXX] Run time  error 10 (plugin "resetscore.amxx") (native "cs_set_user_deaths") -  debug not enabled!
L 10/23/2009 - 14:30:48: [AMXX] To enable debug  mode, add "debug" after the plugin name in plugins.ini (without quotes).
Could someone repair this. I understand that if you put a conditions "is_user_connected(id)" in case false stop execute if true continue.
Thanks
__________________
I'm always searching???
gogubeb is offline
ZhiZha
Member
Join Date: May 2010
Old 07-09-2010 , 04:43   Re: Reset Score
Reply With Quote #25

i have a same problem like hohubeb

Code:
L 07/08/2010 - 22:50:21: Start of error session.
L 07/08/2010 - 22:50:21: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20100708.log")
L 07/08/2010 - 22:50:21: [CSTRIKE] Invalid player 6
L 07/08/2010 - 22:50:21: [AMXX] Displaying debug trace (plugin "resetscore.amxx")
L 07/08/2010 - 22:50:21: [AMXX] Run time error 10: native error (native "cs_set_user_deaths")
L 07/08/2010 - 22:50:21: [AMXX]    [0] phpyV4Pis.sma::reset_score (line 53)
ZhiZha is offline
Daki
BANNED
Join Date: Jul 2010
Old 08-03-2010 , 22:20   Re: Reset Score
Reply With Quote #26

Man
in my server your Plugins running !
But not worked
I Say /resetscore or /restartscore but nothing he not reset my score ?
Maybe have any bugs or something
See first
Daki is offline
Daki
BANNED
Join Date: Jul 2010
Old 08-04-2010 , 20:27   Re: Reset Score
Reply With Quote #27

Quote:
Originally Posted by Daki View Post
Man
in my server your Plugins running !
But not worked
I Say /resetscore or /restartscore but nothing he not reset my score ?
Maybe have any bugs or something
See first
Any Answer ?
Daki is offline
visar1
Member
Join Date: Nov 2009
Old 08-09-2010 , 06:39   Re: Reset Score
Reply With Quote #28

can you code without fun module pleas
visar1 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-23-2011 , 16:22   Re: Reset Score
Reply With Quote #29

I was looking at this plugin after you released some plugin.
I was about unapproving this one, but as it was already approved, gonna let you improve the code as there is not much to do in it.

So, what you have to do :
  • Indent the code properly
  • Use pcvar for all cvars
  • Don't send twice frags and deaths


Sorry, it felt on you
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sammy
Senior Member
Join Date: Feb 2007
Old 03-07-2011 , 02:51   Re: Reset Score
Reply With Quote #30

quick question?
how can i make it so it automatically resets the score (of my choice)....rather than clients typing /resetscore?
sammy
sammy is offline
Reply


Thread Tools
Display Modes

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 10:39.


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