AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] Hud Text Message (https://forums.alliedmods.net/showthread.php?t=318001)

ShutUP99 08-08-2019 15:14

[CS:GO] Hud Text Message
 
2 Attachment(s)
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:

https://user-images.githubuserconten...48425ccdb5.jpg

https://user-images.githubuserconten...1db0c4d34a.jpg

https://user-images.githubuserconten...c8ef8cb8d6.png


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:

Brum Brum 08-08-2019 16:42

Re: [CS:GO] Hud Text Message
 
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);



ShutUP99 08-08-2019 17:11

Re: [CS:GO] Hud Text Message
 
Quote:

Originally Posted by Brum Brum (Post 2662529)
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.

ShutUP99 08-08-2019 17:18

Re: [CS:GO] Hud Text Message
 
Quote:

Originally Posted by Brum Brum (Post 2662529)
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*

Mitchell 08-08-2019 19:46

Re: [CS:GO] Hud Text Message
 
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");



All times are GMT -4. The time now is 11:28.

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