AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Disable HUD at ban (https://forums.alliedmods.net/showthread.php?t=244032)

krysteksulek 07-12-2014 19:50

Disable HUD at ban
 
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?

YamiKaitou 07-12-2014 19:55

Re: Disable HUD at ban
 
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

krysteksulek 07-15-2014 06:02

Re: Disable HUD at ban
 
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)
                }


YamiKaitou 07-15-2014 06:14

Re: Disable HUD at ban
 
containi(ban_reason, "ping") != -1


All times are GMT -4. The time now is 21:16.

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