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

[SOLVED] ShowHudText() issue on CS:S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zack771
Senior Member
Join Date: Apr 2012
Old 03-24-2014 , 12:21   [SOLVED] ShowHudText() issue on CS:S
Reply With Quote #1

Hi,

I'm having issue using ShowHudText(), in my code i've got that to set the HUD to everybody on the server (death people to) :
PHP Code:
public SetScreenMessage() {
    
decl String:screenMessage[255];
    
SetHudTextParams(1.0,-1.0,604800.0,255,255,255,255,0,1.0,0.1,0.0);
    
Format(screenMessage,sizeof(screenMessage),"Capitaine:\n%s\n\nPrisonniers: %i/%i\nGardiens: %i/%i\0",captainName,RealTNumber,TNumber,RealCTNumber,CTNumber);
    for(new 
1;i<=MaxClients;i++) {
        if(
IsClientInGame(i)) {    
            
ShowHudText(i,-1,screenMessage);
        }
    }
    
screenMessage[0]='\0';

But it doesn't work. When i PrintToChatAll() the screenMessage i've got what i want, but no HUD appears on my screen, and screen of others players to.

Does anybody know why ? And how to fix this please ?

Cordially,
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair

Last edited by Zack771; 03-26-2014 at 12:08. Reason: Solved subject.
Zack771 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-24-2014 , 12:53   Re: ShowHudText() issue on CS:S
Reply With Quote #2

A little search could've saved you from the troubles, but ShowHudText will not work in CS:S because of the missing parameter in the client hud.
https://forums.alliedmods.net/showth...howHudText+css
https://forums.alliedmods.net/showthread.php?t=182929
Mitchell is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 03-24-2014 , 13:28   Re: ShowHudText() issue on CS:S
Reply With Quote #3

So i have to use ShowHudSyncText() (and to add the clientscheme.res to the server) ?

But it can't appear on the right-center of player's screen right ? If yes does have another way to print a text on that position of the screen please ?
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-24-2014 , 15:07   Re: ShowHudText() issue on CS:S
Reply With Quote #4

you can only use KeyHint text in cs:s, thats the only alternative.
Mitchell is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 03-25-2014 , 09:51   Re: ShowHudText() issue on CS:S
Reply With Quote #5

And can i print the text i want to the desire position ?

I've searched exemple for Key Hint and i found that :
PHP Code:
static String:sBuffer[64];
Format(sBuffer64COUNT_TXTcount);
new 
Handle:hKHT StartMessageOne("KeyHintText"client); //StarMessageAll() for me
BfWriteByte(hKHT1);
BfWriteString(hKHTsBuffer);
EndMessage(); 
But i don't know where this gonna print on the screen and if it is possible to choose where to print that on the screen.

Maybe i can use \n and \t on the message to change the print position of the text ?
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-25-2014 , 10:47   Re: ShowHudText() issue on CS:S
Reply With Quote #6

It will print on the right side of the player's screen, and there is very little what you can do to position it.
Mitchell is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 03-25-2014 , 11:03   Re: ShowHudText() issue on CS:S
Reply With Quote #7

Ok i'm gonna test this.
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 03-25-2014 , 11:14   Re: ShowHudText() issue on CS:S
Reply With Quote #8

(Sorry for double post)

But first what does this do please :
PHP Code:
BfWriteByte(hKHT1); 
?

What does gonna change if i change the byte value ?
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-25-2014 , 18:45   Re: ShowHudText() issue on CS:S
Reply With Quote #9

Quote:
Originally Posted by Zack771 View Post
(Sorry for double post)

But first what does this do please :
PHP Code:
BfWriteByte(hKHT1); 
?

What does gonna change if i change the byte value ?
As far as I remember, that value needs to stay 1.
__________________
11530 is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 03-26-2014 , 05:49   Re: ShowHudText() issue on CS:S
Reply With Quote #10

Quote:
Originally Posted by 11530 View Post
As far as I remember, that value needs to stay 1.
Ok thank you i test that.
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 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:36.


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