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

[SOLVED] [CSGO] UserMessage HudMsg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 08-31-2014 , 12:04   [SOLVED] [CSGO] UserMessage HudMsg
Reply With Quote #1

Hello,

I'm trying to make the same functions as CS:S in CS:GO,
I tried with this:

Code:
stock HudMsgCsgo(client, channel, Float:x, Float:y, const firstcolor[4], const secondcolor[4], effect, Float:fadein, Float:fadeout, Float:holdtime, Float:fxtime, const String:msg[], any:...)
{
    new Handle:hudhandle = INVALID_HANDLE;
    
    if(client == 0) hudhandle = StartMessageAll("HudMsg");
    else hudhandle = StartMessageOne("HudMsg", client);
    
    new String:texte[255];
    VFormat(texte, sizeof(texte), msg, 13);
    
    if(hudhandle != INVALID_HANDLE)
    {
        PbAddInt(hudhandle, "channel", channel);
        
        new Float:pos[2]; pos[0] = x; pos[1] = y;
        
        PbAddVector2D(hudhandle, "pos", pos);
        PbAddColor(hudhandle, "clr1", firstcolor);
        PbAddColor(hudhandle, "clr2", secondcolor);
        PbAddInt(hudhandle, "effect", effect);
        
        PbAddFloat(hudhandle, "fade_in_time", fadein);
        PbAddFloat(hudhandle, "fade_out_time", fadeout);
        PbAddFloat(hudhandle, "holdtime", holdtime);
        PbAddFloat(hudhandle, "fx_time", fxtime);
        
        PbAddString(hudhandle, "text", msg);
        
        EndMessage();
    }
    
    
}
I found the params name from a dll file in the CSGO folder (client.dll or server.dll) (my npp love opening a dll file):

Code:
CCSUsrMsg_HudMsg
channel (
pos (2
.CMsgVector2D
clr1 (2    .CMsgRGBA
clr2 (2    .CMsgRGBA
effect (
fade_in_time (

fade_out_time (
    hold_time     (
fx_time
 (
text (    "`
When it executes the code, this error is thrown:
[SM] Native "PbAddInt" reported: Invalid field "channel" for message "CCSUsrMsg_HudMsg"

Any idea to fix this ?

thanks in advance
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 09-01-2014 at 01:31.
Razmo51 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-31-2014 , 12:20   Re: [CSGO] UserMessage HudMsg
Reply With Quote #2

The PbAdd* natives are for repeated fields (arrays), to add a value to them.

You want PbSetInt for channel.
psychonic is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-31-2014 , 13:23   Re: [CSGO] UserMessage HudMsg
Reply With Quote #3

Pretty sure HudMsg doesn't even work in CS:GO
Mitchell is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 08-31-2014 , 14:07   Re: [CSGO] UserMessage HudMsg
Reply With Quote #4

you're right, no more errors ,but the message is hidden

Are there other location than Hint and Center (which is on the same location than Hint) ?
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-31-2014 , 18:45   Re: [CSGO] UserMessage HudMsg
Reply With Quote #5

PrintHintText is the only screen message you can show on cs:go
and the chat.
Mitchell is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 09-08-2014 , 11:28   Re: [CSGO] UserMessage HudMsg
Reply With Quote #6

Quote:
Originally Posted by Mitchell View Post
PrintHintText is the only screen message you can show on cs:go
and the chat.
and PrintCenterText, PrintToConsole.

Last edited by TheWho; 09-08-2014 at 11:29.
TheWho is offline
Reply



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 13:05.


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