Raised This Month: $ Target: $400
 0% 

Removing "DEAD" flag on scoreboard (CS)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ricky
Senior Member
Join Date: Jul 2005
Old 11-18-2015 , 18:18   Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #1

Is there a script out there that does this?
Ricky is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-18-2015 , 18:29   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #2

This is client-side and cannot be done using a plugin.
__________________
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-20-2015 , 10:18   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
This is client-side and cannot be done using a plugin.
You can hide or alter the scoreboard flags with ScoreAttrib message(check https://wiki.alliedmods.net/Half-Lif...ts#ScoreAttrib).

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new gmsgScoreAttrib

public plugin_init()
{
    
RegisterHam(Ham_Killed"player""CBasePlayer_Killed"true)
    
    
gmsgScoreAttrib get_user_msgid("ScoreAttrib")
}

public 
CBasePlayer_Killed(Victim)
{
    if(
is_user_connected(Victim))
    {
        
message_begin(MSG_ALLgmsgScoreAttrib)
        {
            
write_byte(Victim)
            
write_byte(0)
            
message_end()
        }
    }

@OP, try this.
__________________
HamletEagle is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-20-2015 , 21:14   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
You can hide or alter the scoreboard flags with ScoreAttrib message(check https://wiki.alliedmods.net/Half-Lif...ts#ScoreAttrib).
Lol, duh, I think that has been established. But hooking the message and altering it doesn't seem to work consistently like you would expect; it would either hide everything or not work at all. Your method seems to work, but I wonder if the message will be sent again eventually and clear out what you set when the player died.

Here is what would be best, if it would work. So if any future messages are sent to update the score board, it would reflect correctly.
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_messageget_user_msgid"ScoreAttrib" ) , "msgScoreAttrib" );
}

public 
msgScoreAttrib(message_idmessage_destid)
{
    if ( !
is_user_aliveget_msg_arg_int) ) )
        
set_msg_arg_intARG_BYTE );

__________________

Last edited by Bugsy; 11-20-2015 at 21:14.
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-21-2015 , 12:12   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Lol, duh, I think that has been established. But hooking the message and altering it doesn't seem to work consistently like you would expect; it would either hide everything or not work at all. Your method seems to work, but I wonder if the message will be sent again eventually and clear out what you set when the player died.

Here is what would be best, if it would work. So if any future messages are sent to update the score board, it would reflect correctly.
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_messageget_user_msgid"ScoreAttrib" ) , "msgScoreAttrib" );
}

public 
msgScoreAttrib(message_idmessage_destid)
{
    if ( !
is_user_aliveget_msg_arg_int) ) )
        
set_msg_arg_intARG_BYTE );

Of course, if another message is send after the one I send on death the scoreboard will be likely updated, but that may not be unwanted behaviour after all. Game won't do this, so without custom plugins that work with ScoreAttrib message all will be okay. Even with custom plugin, it could be welcomed. I mean, if you want to remove "DEAD" you won't use a plugin that adds it. For other flags, you won't have a conflict between plugins(like one trying to show something, and the other something else). You simply remove "DEAD" and allow all the other flags.

About the issue you are talking about, I have to do some tests before saying anything.
__________________

Last edited by HamletEagle; 11-21-2015 at 12:14.
HamletEagle is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-21-2015 , 12:33   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #6

For some reason the gets sent multiple times.

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_messageget_user_msgid"ScoreAttrib" ) , "msgScoreAttrib" );
}

public 
msgScoreAttrib(message_idmessage_destid)
{
    static 
szNameRecip32 ] , szNamePlayer32 ];
    
    
get_user_nameid szNameRecip charsmaxszNameRecip ) );
    
get_user_nameget_msg_arg_int) , szNamePlayer charsmaxszNamePlayer ) );
    
    
server_print"Recipient=%s Player=%s Bits=%d"  szNameRecip szNamePlayer get_msg_arg_int) );

This is after a map change:
Code:
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=1
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=1
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=1
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=2
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[P0D]Bot1 (100) Bits=2
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=1
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=1
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=1
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=1
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=1
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[P0D]Bot1 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[POD]Bot8 (100) Player=[POD]Bot8 (100) Bits=0
Recipient=[P0D]Bot1 (100) Player=[P0D]Bot1 (100) Bits=2
Recipient=[POD]Bot8 (100) Player=[P0D]Bot1 (100) Bits=2
__________________
Bugsy is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 11-18-2015 , 18:33   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #7

not really. You can just send ScoreAttrib message.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-18-2015 , 18:52   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #8

Untested, but should work I guess
PHP Code:
#include <amxmodx>

#pragma semicolon 1

new PLUGIN[]  = "";
new 
AUTHOR[]  = "";
new 
VERSION[] = "0.00";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_message(get_user_msgid("ScoreAttrib"), "msgScoreAttrib");
}

public 
msgScoreAttrib(message_idmessage_destid)
{
    
set_msg_arg_int(2ARG_LONGget_msg_arg_int(2) & ~(<< 0));

With that code, no player will ever have "DEAD" as status on scoreboard.
klippy is offline
Ricky
Senior Member
Join Date: Jul 2005
Old 11-18-2015 , 20:18   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #9

Quote:
Originally Posted by KliPPy View Post
Untested, but should work I guess
PHP Code:
#include <amxmodx>

#pragma semicolon 1

new PLUGIN[]  = "";
new 
AUTHOR[]  = "";
new 
VERSION[] = "0.00";

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_message(get_user_msgid("ScoreAttrib"), "msgScoreAttrib");
}

public 
msgScoreAttrib(message_idmessage_destid)
{
    
set_msg_arg_int(2ARG_LONGget_msg_arg_int(2) & ~(<< 0));

With that code, no player will ever have "DEAD" as status on scoreboard.
Thanks for attempting this. Compiles fine but doesn't work.
Ricky is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-19-2015 , 16:09   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #10

Well, not sure if this is the best way, but i used this in a surf server before and worked fine
Attached Files
File Type: sma Get Plugin or Get Source (surf_score.sma - 625 views - 495 Bytes)
Jhob94 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:14.


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