Raised This Month: $ Target: $400
 0% 

Resetscore does't work.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ratonel
Member
Join Date: Jul 2012
Location: Romania
Old 07-13-2012 , 14:16   Resetscore does't work.
Reply With Quote #1

Hi, i've made a resetscore plugin and for some reason it does't work. It's for a friend a he said that only the messages apear; the score remains the same.

Here's the code:

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

new contor[32]
new 
pcvar_hmtimes
public plugin_init()
{
    
register_plugin("Reset Score""1.0""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 
reset_score(id)
{
    new 
killdead
    kill 
get_user_frags(id); 
    
dead get_user_deaths(id); 
    
    if(!
kill && !dead){
        if(
get_user_flags(id) & ADMIN_LEVEL_F){
            
cs_set_user_deaths(id0)
            
set_user_frags(id0)
            
cs_set_user_deaths(id0)
            
set_user_frags(id0)
            
client_print(idprint_chat"Tocmai ti-ai resetat scorul!"// you've just reseted your score
        
}
        else{
                if(
contor[id]<=get_pcvar_num(pcvar_hmtimes)){
                    
cs_set_user_deaths(id0)
                    
set_user_frags(id0)
                    
cs_set_user_deaths(id0)
                    
set_user_frags(id0)
                    
client_print(idprint_chat"Tocmai ti-ai resetat scorul!"// you've just reseted your score
                    
contor[id]++
                }
                else
                
client_print(idprint_chat"Nu iti mai poti reseta scorul!"// you can't reset your score anymore
            
}
    }
    else 
        
client_print(idprint_chat"Scorul tau este deja 0-0"//your score is already 0-0

For regular players it's only meant to work 2 times (the value of pcvar_hmtimes) and for those who have the flag "r" to work all the time.

P.S.: Sorry for any grammar mistakes or writing mistakes.

Last edited by Ratonel; 07-13-2012 at 14:19.
Ratonel 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