AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [CSGO] New HTML Font supported hud element (https://forums.alliedmods.net/showthread.php?t=326935)

backwards 08-24-2020 05:51

[CSGO] New HTML Font supported hud element
 
Hello, while searching for a new hud element to display text to clients in csgo I found this

https://i.imgur.com/HVgh7DW.png

It's supports HTML Font flags as well and is part of the round end cs panel. Here's a snippet on how it works.

PHP Code:

Event newevent_message CreateEvent("cs_win_panel_round");
newevent_message.SetString("funfact_token""message here");

for(
int z 1<= MaxClientsz++)
  if(
IsClientInGame(z) && !IsFakeClient(z))
    
newevent_message.FireToClient(z);
                                
newevent_message.Cancel(); 

Sadly it has drawbacks of not rendering for 1 second when you send the message. So if you want to constantly update the text like surf\bhop timer, it will be invisible or delayed. Thought I would share this with the community.

Edit:
since people are sending me private messages about this, the way to clear the text is to send a fake round_start event to all clients (this will clear blood decals and particle effects)

PHP Code:

Event newevent_round CreateEvent("round_start");

    for(
int z 1<= MaxClientsz++)
      if(
IsClientInGame(z) && !IsFakeClient(z))
        
newevent_round.FireToClient(z);

    
newevent_round.Cancel(); 


Kubad 08-24-2020 07:26

Re: [CSGO] New HTML Font supported hud element
 
but you cant edit size but seems good

Russian85 08-24-2020 10:53

Re: [CSGO] New HTML Font supported hud element
 
Quote:

Originally Posted by backwards (Post 2715352)
Hello, while searching for a new hud element to display text to clients in csgo I found this

https://i.imgur.com/HVgh7DW.png

It's supports HTML Font flags as well and is part of the round end cs panel. Here's a snippet on how it works.

PHP Code:

Event newevent_message CreateEvent("cs_win_panel_round");
newevent_message.SetString("funfact_token""message here");

for(
int z 1<= MaxClientsz++)
  if(
IsClientInGame(z) && !IsFakeClient(z))
    
newevent_message.FireToClient(z);
                                
event_fake.Cancel(); 

Sadly it has drawbacks of not rendering for 1 second when you send the message. So if you want to constantly update the text like surf\bhop timer, it will be invisible or delayed. Thought I would share this with the community.

Not new.
https://media.discordapp.net/attachm...45/unknown.png
https://media.discordapp.net/attachm...84/unknown.png

backwards 08-24-2020 12:23

Re: [CSGO] New HTML Font supported hud element
 
what public plugin is it in then? also if you want to get technical, i did find this almost 2 years ago, just didn't try html tags

8guawong 08-24-2020 12:55

Re: [CSGO] New HTML Font supported hud element
 
Quote:

Originally Posted by backwards (Post 2715352)
Hello, while searching for a new hud element to display text to clients in csgo I found this

https://i.imgur.com/HVgh7DW.png

It's supports HTML Font flags as well and is part of the round end cs panel. Here's a snippet on how it works.

PHP Code:

Event newevent_message CreateEvent("cs_win_panel_round");
newevent_message.SetString("funfact_token""message here");

for(
int z 1<= MaxClientsz++)
  if(
IsClientInGame(z) && !IsFakeClient(z))
    
newevent_message.FireToClient(z);
                                
event_fake.Cancel(); 

Sadly it has drawbacks of not rendering for 1 second when you send the message. So if you want to constantly update the text like surf\bhop timer, it will be invisible or delayed. Thought I would share this with the community.

thanks for sharing this
any idea how to show pictures? like a few post above
and how to clear the message from screen?

digin 08-24-2020 13:11

Re: [CSGO] New HTML Font supported hud element
 
Quote:

Originally Posted by 8guawong (Post 2715394)
thanks for sharing this
any idea how to show pictures? like a few post above
and how to clear the message from screen?

it works for me
PHP Code:

newevent.SetString("funfact_token"" <img src='image_url'>"); 


MAGNET12 08-24-2020 20:02

Re: [CSGO] New HTML Font supported hud element
 
How did u manage to set up so many colors? new hud is limited to 128 characters only

as for clearing the message, simply send blank ("")

backwards 08-24-2020 23:21

Re: [CSGO] New HTML Font supported hud element
 
Quote:

Originally Posted by MAGNET12 (Post 2715421)
How did u manage to set up so many colors? new hud is limited to 128 characters only

as for clearing the message, simply send blank ("")

It's much larger than 128, i've had like 10000 char buffer pushed to it without any issue. Just need to use new lines \n if the text gets too wide

8guawong 08-25-2020 00:20

Re: [CSGO] New HTML Font supported hud element
 
Quote:

Originally Posted by digin (Post 2715395)
it works for me
PHP Code:

newevent.SetString("funfact_token"" <img src='image_url' width='500' height='600'>"); 


thx that's what i tried yesterday i'm not sure why it did not work for me yesterday but it's working now

Quote:

Originally Posted by MAGNET12 (Post 2715421)
How did u manage to set up so many colors? new hud is limited to 128 characters only

as for clearing the message, simply send blank ("")

thx!

MAGNET12 08-25-2020 04:45

Re: [CSGO] New HTML Font supported hud element
 
Quote:

Originally Posted by backwards (Post 2715431)
It's much larger than 128, i've had like 10000 char buffer pushed to it without any issue. Just need to use new lines \n if the text gets too wide

Strange...here's the most I could squeeze:

https://imgur.com/a/9pEsQ91

Also, did u manage to change the font size somehow? font size doesn't work for me


All times are GMT -4. The time now is 17:59.

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