AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Strange Hudmessage (https://forums.alliedmods.net/showthread.php?t=51441)

Paladinrocker 02-18-2007 01:36

Strange Hudmessage
 
I made a simple hlss blocking plugin, and it works (Thanks to some code I found here by Hawk), but unfortuantely my hud message doesn't work. Here's my code:

Code:

public verifyHlss(id, cvar[], value[])
{
    if(equal(value, "1"))
    {
        new playerName[32];
        get_user_name(id, playerName, 31);
   
        switch(g_blockhlssToggle)
        {
            case 1:
            {
                set_hudmessage(255, 0, 0, 0.20, 0.33, 0, 6.0, 3.0);
                show_hudmessage(0, "%s was gagged for using HLSS", playerName);
                set_speak(id, SPEAK_MUTED);
                client_cmd(id, "voice_inputfromfile 0");
                console_print(0, "[AMXX] Client ^"%s^" gagged for use of HLSS", playerName);
            }
            case 2:
            {
                set_hudmessage(255, 0, 0, 0.20, 0.33, 0, 6.0, 3.0);
                show_hudmessage(0, "%s was kicked for using HLSS", playerName);
                client_cmd(id, "voice_inputfromfile 0");
                server_cmd("kick #%i ^"The use of HLSS is prohibited^"", get_user_userid(id));
                console_print(0, "[AMXX] Client ^"%s^" kicked for use of HLSS", playerName);
            }
        }
    }
}

It's just a little code snippet where it verifies if a user has the cvar "voice_inputfromfile" on or off, and disciplines them according to a setting, but the hud message only displays on the gag, not on the kick. Not sure why, but I feel retarded over this. Thanks a lot guys if you can help.

stupok 02-18-2007 02:08

Re: Strange Hudmessage
 
They look the same to me. Try using -1 as the channel for the hudmessage.

For example,
Code:

set_hudmessage(255, 0, 0, 0.20, 0.33, 0, 6.0, 3.0, 0.1, 0.2, -1);
set_hudmessage()

XxAvalanchexX 02-18-2007 02:50

Re: Strange Hudmessage
 
My guess is that you have a plugin that shows HUD messages on client disconnect, and that message is overriding the HUD channel that you are using.

Paladinrocker 02-18-2007 11:57

Re: Strange Hudmessage
 
OH! That makes sense Avalance, thanks a lot.


All times are GMT -4. The time now is 00:42.

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