Raised This Month: $ Target: $400
 0% 

Code /reset


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuiceU
New Member
Join Date: Jun 2011
Old 06-22-2011 , 08:30   Code /reset
Reply With Quote #1

Hey guys!

I have create my first HLDS server and have Hidenseek By Exolent
so i want to code an /reset, because i want to reset my scores, how can i do it and what code it is and that things, plzz help me!!

Thanks!
GuiceU is offline
Stressful
Senior Member
Join Date: Feb 2011
Old 06-22-2011 , 08:51   Re: Code /reset
Reply With Quote #2

Do you know that This thing actually exist ? :O
Stressful is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 06-22-2011 , 09:06   Re: Code /reset
Reply With Quote #3

You can use ResetScore plugin.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new adtime
new pcvar_Advertise
new pcvar_Display

public plugin_init()
{
    
register_plugin("Reset Score""1.0""Silenttt")
    
    
register_clcmd("say /rs""reset_score")
    
register_clcmd("say /reset""reset_score")
    
register_clcmd("say /resetscore""reset_score")
    
register_clcmd("say /restartscore""reset_score")
    
register_clcmd("say_team /rs""reset_score")
    
register_clcmd("say_team /reset""reset_score")
    
register_clcmd("say_team /resetscore""reset_score")
    
register_clcmd("say_team /restartscore""reset_score")

    
adtime register_cvar("sv_adtime""600")
    
    
pcvar_Advertise register_cvar("sv_rsadvertise""0")

    
pcvar_Display register_cvar("sv_rsdisplay""0")
    
    if(
get_cvar_num("sv_rsadvertise") == 1)
    {
        
set_task(adtime"advertise"___"b")
    }
}

public 
reset_score(id)
{
    
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)")
    }

For resetscore you can use commands:
say /rs
say /reset
say /resetscore
say /restartscore
__________________
Artifact is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 06-22-2011 , 11:55   Re: Code /reset
Reply With Quote #4

check the rules of scripting help section before you post again -.-
Erox902 is offline
GuiceU
New Member
Join Date: Jun 2011
Old 06-22-2011 , 12:13   Re: Code /reset
Reply With Quote #5

Stressful: haha, yeah...
Artifact: Thanks!!!
Erox902:what? ookey?
GuiceU is offline
GuiceU
New Member
Join Date: Jun 2011
Old 06-22-2011 , 12:14   Re: Code /reset
Reply With Quote #6

aha, now i see what u mean, okey, sry, i will remember that...
GuiceU 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 23:32.


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