Raised This Month: $12 Target: $400
 3% 

New custom HUD Messages (CS:GO)


Post New Thread Reply   
 
Thread Tools Display Modes
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 03-21-2017 , 19:12   Re: New custom HUD Messages (CS:GO)
Reply With Quote #11

Quote:
Originally Posted by _GamerX View Post
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
    
DispatchKeyValue(ent"x"x);
    
DispatchKeyValue(ent"y"y);         
    
DispatchSpawn(ent);
    
SetVariantString("!activator");
    
AcceptEntityInput(ent"display"client);

https://developer.valvesoftware.com/wiki/Game_text
do you know the value to set
so it does not have like breathing effect for the text
if you do not know what breating effect is


------------- edit -------------
fadein 0 fadeout 0 holdtime > 0 seems to done it

Last edited by 8guawong; 03-22-2017 at 12:21.
8guawong is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-24-2017 , 06:34   Re: New custom HUD Messages (CS:GO)
Reply With Quote #12

Any work around to get the functions working for CS:GO ?
TheDS1337 is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 03-24-2017 , 14:06   Re: New custom HUD Messages (CS:GO)
Reply With Quote #13

Quote:
Originally Posted by DeagLe.Studio View Post
Any work around to get the functions working for CS:GO ?
What?

Works fine for me:

https://gyazo.com/5eebcb66453d0f1f466ede87bbec934a
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS

Last edited by OSWO; 03-24-2017 at 14:07.
OSWO is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-24-2017 , 15:13   Re: New custom HUD Messages (CS:GO)
Reply With Quote #14

Quote:
Originally Posted by OSWO View Post
How ? using SM's functions or manually creating the entity? (like the stock in this thread)
TheDS1337 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-24-2017 , 15:28   Re: New custom HUD Messages (CS:GO)
Reply With Quote #15

Quote:
Originally Posted by DeagLe.Studio View Post
How ? using SM's functions or manually creating the entity? (like the stock in this thread)
You could just use one entity, and have some kind of functions that allows you to input multiple options for the game_text, like what I've done here: https://github.com/MitchDizzle/Advan...e.sp#L150-L179
Mitchell is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-24-2017 , 15:55   Re: New custom HUD Messages (CS:GO)
Reply With Quote #16

Quote:
Originally Posted by Mitchell View Post
You could just use one entity, and have some kind of functions that allows you to input multiple options for the game_text, like what I've done here: https://github.com/MitchDizzle/Advan...e.sp#L150-L179
Umm.. so this is the only way currently, and we cant use HUD functions integrated in SourceMod?
TheDS1337 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-24-2017 , 16:37   Re: New custom HUD Messages (CS:GO)
Reply With Quote #17

Quote:
Originally Posted by DeagLe.Studio View Post
Umm.. so this is the only way currently, and we cant use HUD functions integrated in SourceMod?
not currently, no, something on csgo's end may need to be fixed to send the message to the client through natives.
Mitchell is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-24-2017 , 17:03   Re: New custom HUD Messages (CS:GO)
Reply With Quote #18

Quote:
Originally Posted by Mitchell View Post
not currently, no, something on csgo's end may need to be fixed to send the message to the client through natives.
Oh, got it. Thanks!
TheDS1337 is offline
g00gl3
Member
Join Date: Feb 2016
Location: bulgaria
Old 03-28-2017 , 19:23   Re: New custom HUD Messages (CS:GO)
Reply With Quote #19

someone can put here an exmple for this new hud

i have this

Code:
stock void hud_message(int client, char[] channel, char[] color, char[] color2, char[] effect, char[] fadein, char[] fadeout, char[] fxtime, char[] holdtime, char[] message, char[] spawnflags, char[] x, char[] 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
    DispatchKeyValue(ent, "x", x);
    DispatchKeyValue(ent, "y", y);         
    DispatchSpawn(ent);
    SetVariantString("!activator");
    AcceptEntityInput(ent, "display", client);
}
but now if i want to print a message i need to do

hud_message(client, "test");
??

and if i want to change color or something someone can help me please ty :-)
g00gl3 is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 04-08-2017 , 14:08   Re: New custom HUD Messages (CS:GO)
Reply With Quote #20

Hi, I was trying to make command to print that hud message but i cant make it work, this is the code:
PHP Code:
public void OnPluginStart()
{
    
RegAdminCmd("sm_hudtext"HudADMFLAG_CONFIG);
}

public 
Action Hud(int clientint args)
{
    if (
args 2)
    {
        
ReplyToCommand(client"[SM]Usage: !hud <player> <message> [OPTIONALS -->] <size 1 - 3> <red (RGB)> <green (RGB)> <blue (RGB)> <x pos> <y pos> <hold time> <fadein time> <fateout time>");
        return 
Plugin_Handled;
    }
    
char arg[64];
    
GetCmdArg(1argsizeof(arg));
    
    
char target_name[MAX_TARGET_LENGTH];
    
int target_list[MAXPLAYERS], target_count;
    
bool tn_is_ml;
    
    
target_count ProcessTargetString(argclienttarget_listMAXPLAYERSCOMMAND_FILTER_CONNECTEDtarget_namesizeof(target_name), tn_is_ml);
    if (
target_count <= 0)
    {
        
ReplyToCommand(client"Target invalid");
        return 
Plugin_Handled;
    }
    
    
char arg2[32];
    
GetCmdArg(2arg2sizeof(arg2));
    
int arg3 GetCmdArgInt(3);
    
int arg4 GetCmdArgInt(4);
    
int arg5 GetCmdArgInt(5);
    
int arg6 GetCmdArgInt(6);
    
float arg7 GetCmdArgFloat(7);
    
float arg8 GetCmdArgFloat(8);
    
float arg9 GetCmdArgFloat(9);
    
float arg10 GetCmdArgFloat(10);
    
float arg11 GetCmdArgFloat(11);
    for (
int i 0target_counti++)
    {
        
PrintToHud(target_list[i], arg2arg3arg4arg5arg6arg7arg8arg9arg10arg11);
//        ReplyToCommand(client, "COMMAND ACTIVETED");
    
}
    return 
Plugin_Handled;
}

int PrintToHud(int client, const char[] messageint size 2int red 255int green 255int blue 255float x = -1.0float y = -1.0float holdtime 5.0float fadeintime 1.0float fadeouttime 1.0)
{
    
int ent CreateEntityByName("game_text");
    
char color[32];
    
Format(colorsizeof(color), "%i %i %i"redgreenblue);
    
    if (
size == 1)
        
size 2;
    else if (
size == 2)
        
size 1;
    
    
char channel[32];
    
char fadein[32];
    
char fadeout[32];
    
char sholdtime[32];
    
char sy[32];
    
char sx[32];
    
IntToString(sizechannelsizeof(channel));
    
FloatToString(fadeintimefadeinsizeof(fadein));
    
FloatToString(fadeouttimefadeoutsizeof(fadeout));
    
FloatToString(holdtimesholdtimesizeof(sholdtime));
    
FloatToString(ysysizeof(sy));
    
FloatToString(xsxsizeof(sx));
    
DispatchKeyValue(ent"channel"channel);
    
DispatchKeyValue(ent"color"color);
    
DispatchKeyValue(ent"color2""0 0 0");
    
DispatchKeyValue(ent"effect""0");
    
DispatchKeyValue(ent"fadein"fadein);
    
DispatchKeyValue(ent"fadeout"fadeout);
    
DispatchKeyValue(ent"fxtime""0.25");
    
DispatchKeyValue(ent"holdtime"sholdtime);
    
DispatchKeyValue(ent"message"message);
    
DispatchKeyValue(ent"spawnflags""0");
    
DispatchKeyValue(ent"x"sx);
    
DispatchKeyValue(ent"y"sy);
    
DispatchSpawn(ent);
    
SetVariantString("!activator");
    return 
AcceptEntityInput(ent"display"client);

Thanks in advance.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 04-08-2017 at 14:08.
Papero 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 17:27.


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