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

Reset score problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-08-2012 , 08:29   Reset score problem
Reply With Quote #1

Can someone help with this error

Code:
L 02/08/2012 - 14:01:24: [CSTRIKE] Invalid player 21
L 02/08/2012 - 14:01:24: [AMXX] Displaying debug trace (plugin "ressetscore.amxx")
L 02/08/2012 - 14:01:24: [AMXX] Run time error 10: native error (native "cs_set_user_deaths")
L 02/08/2012 - 14:01:24: [AMXX]    [0] rs.sma::reset_score (line 56)
PHP Code:
#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(id0)
    
set_user_frags(id0)
56 -->    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")
    }
    return 
PLUGIN_HANDLED
}

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

__________________
H.RED.ZONE is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-08-2012 , 08:58   Re: Reset score problem
Reply With Quote #2

PHP Code:
#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(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")
    }
    return 
PLUGIN_HANDLED
}

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

Wtf was the 56 --> supposed to be at line 41? lol
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-08-2012 , 09:46   Re: Reset score problem
Reply With Quote #3

I removed credits and posted only the code i showed what line i get error...

PHP Code:
56 -->    cs_set_user_deaths(id0
I showed on what line i have problem
__________________

Last edited by H.RED.ZONE; 02-08-2012 at 09:47.
H.RED.ZONE is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 02-08-2012 , 09:55   Re: Reset score problem
Reply With Quote #4

Try this:

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define adtime 600.0 new pcvar_Advertise new pcvar_Display public plugin_init() {     register_plugin("Reset Score", "1.0", "Silenttt")         register_clcmd("say /resetscore", "reset_score")     register_clcmd("say /restartscore", "reset_score")     register_clcmd("say /rs", "reset_score")         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) {     if(is_user_connected(id))     {         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_print(id, print_chat, "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)")     } }
__________________
kramesa is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 02-08-2012 , 12:33   Re: Reset score problem
Reply With Quote #5

Check if user is connected could work ill report back.

EDIT: Works Thanks.
__________________

Last edited by H.RED.ZONE; 02-08-2012 at 15:28.
H.RED.ZONE 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 18:05.


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