Raised This Month: $ Target: $400
 0% 

Resetscore does't work.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-13-2012 , 14:58   Re: Resetscore does't work.
Reply With Quote #2

Instead of if( !dead && !kill ) you should check if( dead || kill ) aka if( dead != 0 || kill != 0 ).

Try this :
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define m_iDeaths 444

new connor[33]
new 
pcvar_hmtimes

public plugin_init()
{
    
register_plugin("Reset Score""1.1""Whatever")
    
    
register_clcmd("say /resetscore""reset_score")
    
register_clcmd("say /rs""reset_score")    
    
register_clcmd("say_team /resetscore""reset_score")
    
register_clcmd("say_team /rs""reset_score")

    
pcvar_hmtimes register_cvar("resetscore_max""2")

}

public 
client_putinserverid )
{
    
connorid ] = 0
}

public 
reset_score(id)
{
    new 
frags get_user_fragsid )

    if( 
frags || get_pdata_int(idm_iDeaths) )
    {
        if( 
get_user_flags(id) & ADMIN_LEVEL_F || ++connor[id] < get_pcvar_num(pcvar_hmtimes) )
        {
            
set_pdata_int(idm_iDeaths0)
            
ExecuteHam(Ham_AddPointsid, -frags1)
            
client_print(idprint_chat"Tocmai ti-ai resetat scorul!"// you've just reseted your score
        
}
        else
        {
            
client_print(idprint_chat"Nu iti mai poti reseta scorul!"// you can't reset your score anymor
        
}
    }
    else 
    {
        
client_print(idprint_chat"Scorul tau este deja 0-0"//your score is already 0-0
    
}

If you want to keep old method, replace :

cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)

with


set_user_frags(id, 0)
cs_set_user_deaths(id, 0) // make sure to place that one in 2nd position.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-13-2012 at 14:59.
ConnorMcLeod is offline
 



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 15:09.


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