Raised This Month: $ Target: $400
 0% 

Removing "DEAD" flag on scoreboard (CS)


Post New Thread Reply   
 
Thread Tools Display Modes
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 #11

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 #12

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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-21-2015 , 16:00   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #13

Essentially: Team choice / Hud init / Spawn() / Killed() / Bomb icon update / Change team / Disconnection
Sent to all players each time.
__________________

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

Do you know why what I have in post #9 is not working? As I understand, this should modify the message before it is actually sent.
__________________
Bugsy is offline
Old 11-21-2015, 16:22
Arkshine
This message has been deleted by Arkshine. Reason: nvm
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-21-2015 , 17:24   Re: Removing "DEAD" flag on scoreboard (CS)
Reply With Quote #15

I don't know.

I would guess that it's overwritten later by some internal code. What does ScoreAttrib is basically setting whatever there is death flag to g_PlayerExtraInfo[index].dead. But .dead is use also in some others functions.

Well, looking at IDA, .dead is set either in __MsgFunc_ScoreAttrib (message is parsed here) or CCSClientScoreBoardDialog::DeathMsg(), but the latter I have no idea from where it's called because it's a virtual function and you have no direct reference. I can't say at what point it's triggered.

So, I suppose for death, you have no choice to resend a new message once you are fully killed.
__________________

Last edited by Arkshine; 11-21-2015 at 17:33.
Arkshine 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 09:19.


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