Raised This Month: $ Target: $400
 0% 

Disable HUD at ban


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
krysteksulek
Member
Join Date: Aug 2013
Location: Poland
Old 07-12-2014 , 19:50   Disable HUD at ban
Reply With Quote #1

Hi.
I have plugin which ban to AmxBans due to high ping.
I want to disable HUD message BAN only for this plugin (sometimes many players have high ping, and on server HUD only spam's).
I know, that i can change show_activity at ban moment, but it's not good solution.
Any ideas?
krysteksulek is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-12-2014 , 19:55   Re: Disable HUD at ban
Reply With Quote #2

That will involve editing both AMXBans and your high ping plugin. The easiest way would be to alter AMXBans to check the ban reason and then not show the HUD message when it equals a specific reason
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
krysteksulek
Member
Join Date: Aug 2013
Location: Poland
Old 07-15-2014 , 06:02   Re: Disable HUD at ban
Reply With Quote #3

Ok. So i have that code in AmxBans:

Code:
case 1:
        {
            new playerCount, idx, players[32]
            get_players(players, playerCount)
            for (idx=0; idx<playerCount; idx++) {
                if (is_user_hltv(players[idx]) || is_user_bot(players[idx])) continue // Dont count HLTV or bots as players
                
                get_time_length(players[idx], iBanLength, timeunit_minutes, cTimeLengthPlayer, 127)
                
                if (g_choiceTime[id] > 0)
                    format(message,190,"%L", players[idx],"PUBLIC_BAN_ANNOUNCE", pl_nick, cTimeLengthPlayer, ban_reason)
                else
                    format(message,190,"%L", players[idx],"PUBLIC_BAN_ANNOUNCE_PERM", pl_nick, ban_reason)
                
                if ( get_pcvar_num(pcvar_show_hud_messages) == 1 ) 
                {
                    set_hudmessage(0, 255, 0, 0.05, 0.30, 0, 6.0, 10.0 , 0.5, 0.15, -1)
                    ShowSyncHudMsg(players[idx], g_MyMsgSync, "%s", message)
                }
                //client_print(players[idx],print_chat, "%s", message)
                ColorChat(players[idx], RED, "[AMXBans]^x01 %s", message)
                client_print(players[idx],print_console, "%s", message)
            }
        }
How to catch ban reason? I tried something like this, but it's not correct:

Code:
if ( get_pcvar_num(pcvar_show_hud_messages) == 1 && ban_reason != "Ping") 
                {
                    set_hudmessage(0, 255, 0, 0.05, 0.30, 0, 6.0, 10.0 , 0.5, 0.15, -1)
                    ShowSyncHudMsg(players[idx], g_MyMsgSync, "%s", message)
                }
krysteksulek is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-15-2014 , 06:14   Re: Disable HUD at ban
Reply With Quote #4

containi(ban_reason, "ping") != -1
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply


Thread Tools
Display Modes

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 21:16.


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