Raised This Month: $ Target: $400
 0% 

256 deaths can still crash HLDS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MAUGHOLD
Veteran Member
Join Date: Nov 2004
Location: CA USA
Old 12-28-2011 , 19:54   256 deaths can still crash HLDS
Reply With Quote #1

This plugin works, but once the player get's their kills reset, and then goes on to get 256 deaths, the server still crashes.

Also, the say to the player about their score being reset, doesn't seem to stay on the screen long enough.

Can someone fix this so that it resets a players deaths ?

Thanks.
Attached Files
File Type: sma Get Plugin or Get Source (dod_xkills.sma - 569 views - 3.8 KB)
__________________
{FJ}Justice STEAM_0:0:633975 If anyone needs any help with their server, Just add me to steam friends and I'll help you out.
MAUGHOLD is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2011 , 01:35   Re: 256 deaths can still crash HLDS
Reply With Quote #2

Have you tried dod_maxkds 254 instead of 255 ?
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-30-2011 at 01:58. Reason: See #6
ConnorMcLeod is offline
MAUGHOLD
Veteran Member
Join Date: Nov 2004
Location: CA USA
Old 12-29-2011 , 02:21   Re: 256 deaths can still crash HLDS
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Have you tried dod_maxkds 254 instead of 255 ?
yes, it doesn't seem to matter, what you set it to. it just wasn't counting deaths.

I just crashed a server running the version that I posted here. I noticed that my deaths were at 259 and the server crashed.

Thanks connor, I will try you're version
__________________
{FJ}Justice STEAM_0:0:633975 If anyone needs any help with their server, Just add me to steam friends and I'll help you out.

Last edited by MAUGHOLD; 12-29-2011 at 02:24.
MAUGHOLD is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2011 , 02:29   Re: 256 deaths can still crash HLDS
Reply With Quote #4

If it works, i'll look in dodx module, maybe i can remove those messages hooks and use client_score + client_death + 1 msg hook left.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MAUGHOLD
Veteran Member
Join Date: Nov 2004
Location: CA USA
Old 12-29-2011 , 02:43   Re: 256 deaths can still crash HLDS
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
If it works, i'll look in dodx module, maybe i can remove those messages hooks and use client_score + client_death + 1 msg hook left.
Can you add a way to quickly test this by adding kills to an admins deaths with the amxmodx menu ?

I can set the dod_maxkds to 10 and upload the amxx.cfg. buts it's easier doing it in game with the cvar menu.

It resets both kills and deaths, but it doesn't notify the player about either.
__________________
{FJ}Justice STEAM_0:0:633975 If anyone needs any help with their server, Just add me to steam friends and I'll help you out.

Last edited by MAUGHOLD; 12-29-2011 at 03:30.
MAUGHOLD is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2011 , 11:36   Re: 256 deaths can still crash HLDS
Reply With Quote #6

Better to stay with register_message.

PHP Code:
/*    Formatright © 2011, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#define TEST_PLUGIN

#include <amxmodx>
#include <dodfun>

#if defined TEST_PLUGIN
    #include <amxmisc>
#endif

#define VERSION "0.0.3"
#define PLUGIN "Dod Max Score"

new dod_maxkds

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
dod_maxkds register_cvar("dod_maxkds""255")
    
register_message(get_user_msgid("ScoreShort"), "Message_ScoreShort"// dod_set_pl_deaths
    
register_message(get_user_msgid("ObjScore"), "Message_ObjScore"// dod_set_user_score
    
register_message(get_user_msgid("Frags"), "Message_Frags"// dod_set_user_kills

    #if defined TEST_PLUGIN
        
register_concmd("dod_set_user_score""ClCmd_SetUserScore""<name/steam/#userid> <frags> <deaths> <score>")
    
#endif
}

public 
Message_Frags(iMsgIdiMsgDestiMsgEnt)
{
    if( 
get_msg_arg_int(2) >= get_pcvar_numdod_maxkds ) )
    {
        
set_msg_arg_int(2ARG_SHORT0)
        new 
id get_msg_arg_int(1)
        if( 
dod_set_user_stats(id000, .updatefrags=0) )
        {
            
NotifyReset(id)
        }
    }
}

public 
Message_ObjScore(iMsgIdiMsgDestiMsgEnt)
{
    if( 
get_msg_arg_int(2) >= get_pcvar_numdod_maxkds ) )
    {
        
set_msg_arg_int(2ARG_SHORT0)
        new 
id get_msg_arg_int(1)
        if( 
dod_set_user_stats(id000, .updatescore=0) )
        {
            
NotifyReset(id)
        }
    }
}

public 
Message_ScoreShort(iMsgIdiMsgDestiMsgEnt)
{
    new 
iMaxKds get_pcvar_numdod_maxkds )
    if(    
get_msg_arg_int(2) >= iMaxKds
    
||        get_msg_arg_int(3) >= iMaxKds
    
||        get_msg_arg_int(4) >= iMaxKds        )
    {
        
set_msg_arg_int(2ARG_SHORT0)
        
set_msg_arg_int(3ARG_SHORT0)
        
set_msg_arg_int(4ARG_SHORT0)

        new 
id get_msg_arg_int(1)
        if( 
dod_set_user_stats(id000, .updatedeaths=0) )
        {
            
NotifyReset(id)
        }
    }
}

dod_set_user_stats(idfragsdeathsscoreupdatefrags=1updatedeaths=1updatescore=1)
{
    if( 
is_user_connected(id) )
    {
        
dod_set_user_kills(idfragsupdatefrags)
        
dod_set_pl_deaths(iddeathsupdatedeaths)
        
dod_set_user_score(idscoreupdatescore)
        return 
1
    
}
    return 
0
}

NotifyResetid )
{
    static 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
    
client_print(idprint_chat" ** %s, Your score has been reset to prevent the server from crashing."szName)
}

#if defined TEST_PLUGIN
public ClCmd_SetUserScore(idlvlcid)
{
    if( !
cmd_access(idlvlcid5) )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szTarget[32]
    
read_argv(1szTargetcharsmax(szTarget))
    new 
plr cmd_target(idszTargetCMDTARGET_ALLOW_SELF|CMDTARGET_OBEY_IMMUNITY)
    if( 
plr )
    {
        new 
szFrags[4], szDeaths[4], szScore[4]
        
read_argv(2szFragscharsmax(szFrags))
        
read_argv(3szDeathscharsmax(szDeaths))
        
read_argv(4szScorecharsmax(szScore))
        
dod_set_user_stats
        
(
            
plr,
            
str_to_numszFrags ),
            
str_to_numszDeaths ),
            
str_to_numszScore )
        )
    }
    return 
PLUGIN_HANDLED
}
#endif 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-30-2011 at 01:57. Reason: Add notifications
ConnorMcLeod is offline
MAUGHOLD
Veteran Member
Join Date: Nov 2004
Location: CA USA
Old 12-29-2011 , 14:31   Re: 256 deaths can still crash HLDS
Reply With Quote #7

Since many admins run 24/7 servers with very long map rotations, many players will get their scores reset, is there a way to still show all of those players true amount of kills at the end of the map, so the player with the most kills will still show as the number one killer when the map ends ?

Testing it right now. thanks.
__________________
{FJ}Justice STEAM_0:0:633975 If anyone needs any help with their server, Just add me to steam friends and I'll help you out.

Last edited by MAUGHOLD; 12-29-2011 at 14:39.
MAUGHOLD is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2011 , 15:46   Re: 256 deaths can still crash HLDS
Reply With Quote #8

First, we should figure out what makes server crash and why.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MAUGHOLD
Veteran Member
Join Date: Nov 2004
Location: CA USA
Old 12-29-2011 , 15:50   Re: 256 deaths can still crash HLDS
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
First, we should figure out what makes server crash and why.
HLDS has always crashed when any player gets 256 kills, but when the original plugin was made, I'm not sure if the author new that HLDS would also crash when any player gets 256 deaths.
__________________
{FJ}Justice STEAM_0:0:633975 If anyone needs any help with their server, Just add me to steam friends and I'll help you out.

Last edited by MAUGHOLD; 12-29-2011 at 15:50.
MAUGHOLD is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-29-2011 , 15:57   Re: 256 deaths can still crash HLDS
Reply With Quote #10

And what is "score" ? And does it has the same problem ?
But why does HLDS crashed ? It doesn't happen when you launch a listenserver ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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:31.


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