AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   New custom HUD Messages (CS:GO) (https://forums.alliedmods.net/showthread.php?t=295243)

_GamerX 03-20-2017 06:26

New custom HUD Messages (CS:GO)
 
PHP Code:

stock void hud_message(int clientchar[] channelchar[] colorchar[] color2char[] effectchar[] fadeinchar[] fadeoutchar[] fxtimechar[] holdtimechar[] messagechar[] spawnflagschar[] xchar[] y)
{
    
int ent CreateEntityByName("game_text");
    
DispatchKeyValue(ent"channel"channel);
    
DispatchKeyValue(ent"color"color);
    
DispatchKeyValue(ent"color2"color2);
    
DispatchKeyValue(ent"effect"effect);
    
DispatchKeyValue(ent"fadein"fadein);
    
DispatchKeyValue(ent"fadeout"fadeout);
    
DispatchKeyValue(ent"fxtime"fxtime);         
    
DispatchKeyValue(ent"holdtime"holdtime);
    
DispatchKeyValue(ent"message"message);
    
DispatchKeyValue(ent"spawnflags"spawnflags); //1 = show for all players
    
DispatchKeyValue(ent"x"x);
    
DispatchKeyValue(ent"y"y);         
    
DispatchSpawn(ent);
    
SetVariantString("!activator");
    
AcceptEntityInput(ent"display"client);
    
DispatchKeyValue(ent"OnUser1""!self,Kill,,%s,-1"holdtime);
    
AcceptEntityInput(ent"FireUser1");


https://developer.valvesoftware.com/wiki/Game_text

TheDS1337 03-20-2017 06:30

Re: New custom HUD Messages (CS:GO)
 
I think waiting for a new Sourcemod patch to add support is the best thing to do now.

psychonic 03-20-2017 07:29

Re: New custom HUD Messages (CS:GO)
 
The HudText/HudSynchronizer natives work in CS:GO now.

TheDS1337 03-20-2017 08:00

Re: New custom HUD Messages (CS:GO)
 
Quote:

Originally Posted by psychonic (Post 2505068)
The HudText/HudSynchronizer natives work in CS:GO now.

This is truly amazing! Thanks for the addition

EDIT: This code doesnt seem to work :/
Code:

SetHudTextParams(0.05, 0.45, 5.0, 255, 0, 0, 200, 0, 0.25, 1.0, 1.0);
ShowSyncHudText(client, g_Hud, "TEST TEST TEST");

Tried the same thing with ShowHudText instead and it doesnt work.

psychonic 03-20-2017 18:44

Re: New custom HUD Messages (CS:GO)
 
Quote:

Originally Posted by DeagLe.Studio (Post 2505081)
This is truly amazing! Thanks for the addition

EDIT: This code doesnt seem to work :/
Code:

SetHudTextParams(0.05, 0.45, 5.0, 255, 0, 0, 200, 0, 0.25, 1.0, 1.0);
ShowSyncHudText(client, g_Hud, "TEST TEST TEST");

Tried the same thing with ShowHudText instead and it doesnt work.

Do you have the latest gamedata?

Mitchell 03-20-2017 19:15

Re: New custom HUD Messages (CS:GO)
 
This is a misleading title, it's not new, just you couldn't use it before since the client files were not properly setup. Just like it was in CS:S, which was fixed in both games now.

TheDS1337 03-21-2017 01:22

Re: New custom HUD Messages (CS:GO)
 
Quote:

Originally Posted by psychonic (Post 2505247)
Do you have the latest gamedata?

Yes, and I tried using the build-6066 from the Dev Builds too.

kossolax 03-21-2017 02:16

Re: New custom HUD Messages (CS:GO)
 
It's my fault. It should be "game" instead of "engine": https://github.com/alliedmodders/sourcemod/pull/598

TheDS1337 03-21-2017 02:23

Re: New custom HUD Messages (CS:GO)
 
Quote:

Originally Posted by kossolax (Post 2505303)
It's my fault. It should be "game" instead of "engine": https://github.com/alliedmodders/sourcemod/pull/598

Yeah, I was trying to change it to game but I couldnt because I guess sourcemod instantly change it back to "engine" after startup

psychonic 03-21-2017 07:33

Re: New custom HUD Messages (CS:GO)
 
Quote:

Originally Posted by kossolax (Post 2505303)
It's my fault. It should be "game" instead of "engine": https://github.com/alliedmodders/sourcemod/pull/598

That wouldn't cause it not to work since CS:GO matches either of those. If the natives still don't work with the gamedata as-is, it could be an issue with our implementation.


All times are GMT -4. The time now is 06:47.

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