Raised This Month: $89 Target: $400
 22% 

[CS:GO] Hud Text Message


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ShutUP99
Junior Member
Join Date: Jan 2018
Location: Portuguese
Plugin ID:
6673
Plugin Version:
1.0
Plugin Category:
Admin Commands
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    This plugin send a message in the HUD with the mentioned args.
    Old 08-08-2019 , 14:14   [CS:GO] Hud Text Message
    Reply With Quote #1

    Description:

    This plugin send a message in the HUD with the mentioned args.


    Requirements:


    Requirements (To compile):

    Commands:
    • sm_hudtext - Send the message you wanted to.
    • sm_htm - Send the message you wanted to (An alias to hudtext).


    Screenshots:








    ConVars:
    • sm_htm_flag (Default: o) - Flag needed for command usage.
    • sm_htm_x (Default: -1.0) - Horizontal Position to show the displayed message (To be centered, set as -1.0).
    • sm_htm_y (Default: 0.1) - Vertical Position to show the displayed message (To be centered, set as -1.0).
    • sm_htm_holdtime (Default: 2.0) - Time that the message is shown.
    • sm_htm_r (Default: 255) - RGB Red Color to the displayed message.
    • sm_htm_g (Default: 255) - RGB Green Color to the displayed message.
    • sm_htm_b (Default: 255) - RGB Blue Color to the displayed message.
    • sm_htm_transparency (Default: 100) - Message Transparency Value.
    • sm_htm_effect (Default: 1.0) - 0 - Fade In; 1 - Fade out; 2 - Flash
    • sm_htm_effectduration (Default: 0.5) - Duration of the selected effect. Not always aplicable
    • sm_htm_fadeinduration (Default: 0.5) - Duration of the selected effect.
    • sm_htm_fadeoutduration (Default: 0.5) - Duration of the selected effect.


    Credits:
    • Pinto for the idea and some plugin code.
    • SpirtBBX for helping with the code.


    Download plugin:

    Other things related to the plugin:
    Attached Files
    File Type: sp Get Plugin or Get Source (shutap_htm.sp - 15 views - 4.2 KB)
    File Type: zip Hud-Text-Message-1.0.zip (10.4 KB, 13 views)

    Last edited by ShutUP99; 08-08-2019 at 16:21. Reason: Forgot 1 person on credits
    ShutUP99 is offline
    Brum Brum
    Junior Member
    Join Date: Mar 2017
    Old 08-08-2019 , 15:42   Re: [CS:GO] Hud Text Message
    Reply With Quote #2

    so you only show the message to the person who used it?

    Quote:
    SetHudTextParams(htm_x, htm_y, htm_holdtime, htm_red, htm_green, htm_blue, htm_transparency, htm_effect, htm_effectduration, htm_fadein, htm_fadeout);
    ShowSyncHudText(client, HTM, message);
    PHP Code:
    for (int i 1<= MaxClients;i++)
    {
        if (!
    IsClientInGame(i) || IsFakeClient(i))continue;
        
        
    ShowSyncHudText(iHTMmessage);

    Brum Brum is offline
    ShutUP99
    Junior Member
    Join Date: Jan 2018
    Location: Portuguese
    Old 08-08-2019 , 16:11   Re: [CS:GO] Hud Text Message
    Reply With Quote #3

    Quote:
    Originally Posted by Brum Brum View Post
    so you only show the message to the person who used it?



    PHP Code:
    for (int i 1<= MaxClients;i++)
    {
        if (!
    IsClientInGame(i) || IsFakeClient(i))continue;
        
        
    ShowSyncHudText(iHTMmessage);

    I'll try.
    __________________

    Last edited by ShutUP99; 08-08-2019 at 16:13.
    ShutUP99 is offline
    ShutUP99
    Junior Member
    Join Date: Jan 2018
    Location: Portuguese
    Old 08-08-2019 , 16:18   Re: [CS:GO] Hud Text Message
    Reply With Quote #4

    Quote:
    Originally Posted by Brum Brum View Post
    so you only show the message to the person who used it?



    PHP Code:
    for (int i 1<= MaxClients;i++)
    {
        if (!
    IsClientInGame(i) || IsFakeClient(i))continue;
        
        
    ShowSyncHudText(iHTMmessage);

    Thx, it worked.

    *Sry for my dumbness*
    __________________
    ShutUP99 is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 08-08-2019 , 18:46   Re: [CS:GO] Hud Text Message
    Reply With Quote #5

    You don't need a flag convar, just set it to default the Admin Chat flag and just rely on Sourcemod's Command overrides to do the rest. This saves you from having a registered convar and from jerry-rigging the RegAdminCmd before OnConfigsExecuted. Pretty sure since you set the command flag before OnConfigsExecuted there's no way of changing it via the config anyways it will always be the default value.

    Yeah actually you have a lot of logic that isn't needed, you retrieve the convar as an int then convert it to string...
    and you do this logic twice if the flag convar turns out to be blank:
    Code:
    HTM = CreateHudSynchronizer();
    AutoExecConfig(true, "plugin.shutap_htm");
    __________________

    Last edited by Mitchell; 08-08-2019 at 18:48.
    Mitchell 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 06:27.


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