AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Removing "DEAD" flag on scoreboard (CS) (https://forums.alliedmods.net/showthread.php?t=274951)

Ricky 11-18-2015 18:18

Removing "DEAD" flag on scoreboard (CS)
 
Is there a script out there that does this?

Bugsy 11-18-2015 18:29

Re: Removing "DEAD" flag on scoreboard (CS)
 
This is client-side and cannot be done using a plugin.

NiHiLaNTh 11-18-2015 18:33

Re: Removing "DEAD" flag on scoreboard (CS)
 
not really. You can just send ScoreAttrib message.

klippy 11-18-2015 18:52

Re: Removing "DEAD" flag on scoreboard (CS)
 
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.

Ricky 11-18-2015 20:18

Re: Removing "DEAD" flag on scoreboard (CS)
 
Quote:

Originally Posted by KliPPy (Post 2364304)
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.

Jhob94 11-19-2015 16:09

Re: Removing "DEAD" flag on scoreboard (CS)
 
1 Attachment(s)
Well, not sure if this is the best way, but i used this in a surf server before and worked fine

Ricky 11-19-2015 21:15

Re: Removing "DEAD" flag on scoreboard (CS)
 
Quote:

Originally Posted by Jhob94 (Post 2364590)
Well, not sure if this is the best way, but i used this in a surf server before and worked fine

Thanks for sharing! This works but also removes "BOMB" or "VIP" status as well.

HamletEagle 11-20-2015 10:18

Re: Removing "DEAD" flag on scoreboard (CS)
 
Quote:

Originally Posted by Bugsy (Post 2364298)
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.

Bugsy 11-20-2015 21:14

Re: Removing "DEAD" flag on scoreboard (CS)
 
Quote:

Originally Posted by HamletEagle (Post 2364781)
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 );



klippy 11-21-2015 04:27

Re: Removing "DEAD" flag on scoreboard (CS)
 
Could it be that my code wasn't working properly because I put ARG_LONG instead of ARG_BYTE? I just saw that the second argument is of byte type. Oh well.


All times are GMT -4. The time now is 18:14.

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