Raised This Month: $ Target: $400
 0% 

simple reset score log


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
slypire
Junior Member
Join Date: May 2013
Old 08-10-2013 , 03:15   simple reset score log
Reply With Quote #1

Hi guys, i made one simple plugin for /rs, /resetscore and I get next log:

Code:
L 08/10/2013 - 00:52:53: [AMXX] Displaying debug trace (plugin "explosion_rs.amxx")
L 08/10/2013 - 00:52:53: [AMXX] Run time error 10: native error (native "cs_set_user_deaths")
L 08/10/2013 - 00:52:53: [AMXX]    [0] explosion_rs.sma::cmdReset (line 25)
L 08/10/2013 - 00:54:20: Invalid player id 128

there is a .sma

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

#define PLUGIN "rs basic"
#define VERSION "1.0"
#define AUTHOR "Author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /resetscore""cmdReset")
    
register_clcmd("say /restartscore""cmdReset")
    
register_clcmd("say /rs""cmdReset")
    
    
register_clcmd("say_team /resetscore""cmdReset")
    
register_clcmd("say_team /restartscore""cmdReset")
    
register_clcmd("say_team /rs""cmdReset")
    
}

public 
cmdReset(id){
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
    
ColorChat(idGREEN"^4[Resete Score] ^1Uspesno ste resetovali skor!")    
    

And line 25 is cs_set_user_deaths(id, 0) first time ..
thanks

Last edited by slypire; 08-10-2013 at 03:15.
slypire is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-10-2013 , 04:34   Re: simple reset score log
Reply With Quote #2

I'd say this is impossible. The code you have provided should work unless you have some other function that is calling cmdReset() that we can't see.

You don't need to set deaths and frags twice, one time each is enough.
__________________
Black Rose is offline
slypire
Junior Member
Join Date: May 2013
Old 08-10-2013 , 04:38   Re: simple reset score log
Reply With Quote #3

When i set deaths and frags just one time, then plugin dont resetscore to player x)
slypire is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 08-10-2013 , 08:53   Re: simple reset score log
Reply With Quote #4

Quote:
Originally Posted by slypire View Post
When i set deaths and frags just one time, then plugin dont resetscore to player x)
When you set it only one time, the score will be updated only next round
__________________
simanovich is offline
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 08-10-2013 , 11:47   Re: simple reset score log
Reply With Quote #5

Try this:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <colorchat>

#define PLUGIN "rs basic"
#define VERSION "1.0"
#define AUTHOR "Author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /resetscore""cmdReset")
    
register_clcmd("say /restartscore""cmdReset")
    
register_clcmd("say /rs""cmdReset")
    
    
register_clcmd("say_team /resetscore""cmdReset")
    
register_clcmd("say_team /restartscore""cmdReset")
    
register_clcmd("say_team /rs""cmdReset")
    
}

public 
cmdReset(id){
    if( !
is_user_bot(id) && 1<=id<=get_maxplayers() ) {
           
cs_set_user_deaths(id0)
           
set_user_frags(id0)
           
cs_set_user_deaths(id0)
           
set_user_frags(id0)
    
           
ColorChat(idGREEN"^4[Resete Score] ^1Uspesno ste resetovali skor!")   
    } 
    return 
PLUGIN_HANDLED


Last edited by DWIGHTpN; 08-10-2013 at 11:48.
DWIGHTpN is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-10-2013 , 12:18   Re: simple reset score log
Reply With Quote #6

PHP Code:
public cmdReset(id){
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
    
client_print(idprint_chat"^4[Resete Score] ^1Uspesno ste resetovali skor!")    
    



PHP Code:
public cmdReset(id){
    
cs_set_user_deaths(id0)
    
set_user_frags(id0)
    
    
client_print(idprint_chat"^4[Resete Score] ^1Uspesno ste resetovali skor!")        

Then update players frags in the scoreboard.

@DWIGHTpN

No.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 00:05.


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