Raised This Month: $ Target: $400
 0% 

OnGameFrame GUI


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-16-2009 , 10:06   OnGameFrame GUI
Reply With Quote #1

I want to display data that is changed every frame (coordinates mostly). I've tried PrintCenterTextAll, it's working but has some bad size limits. PrintHintTextToAll is ear rape. Was unable to get ShowHudText working. So, how do I use ShowHudText and what are other possibilities?
FaTony is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-16-2009 , 10:13   Re: OnGameFrame GUI
Reply With Quote #2

Hud text is not supported on every game (notably missing on CS:S and DOD:S). You could try a tsay-style message, but I don't know if those can update that fast.
psychonic is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-16-2009 , 10:17   Re: OnGameFrame GUI
Reply With Quote #3

TF2. What's tsay-style message?
FaTony is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-16-2009 , 10:42   Re: OnGameFrame GUI
Reply With Quote #4

If it's just for tf2, Your best bet is probably to use Hud text. If you're having trouble with it still, paste your code.

By tsay-style, I mean the type of message sm_tsay does. See Sourcemod's basechat.sp for an example.
psychonic is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-16-2009 , 11:37   Re: OnGameFrame GUI
Reply With Quote #5

PHP Code:
SetHudTextParams(0.60.61.012812812812800.00.00.0);
for (new 
i=0;i<MaxClients;i++) {
       
ShowHudText(i1"Foo");
       } 
FaTony is offline
Theme97
Senior Member
Join Date: Mar 2009
Old 12-17-2009 , 08:07   Re: OnGameFrame GUI
Reply With Quote #6

Client indices are 1 to MaxClients (inclusive). The script is probably erroring out at client 0 (world). You should also add checks to see if the client exists, or else it'll probably fail as well.

PHP Code:
for (new 1<= MaxClientsi++) {
    if (
IsClientInGame(i)) {
        
ShowHudText(i1"foo");
    }

__________________
I now have very little time to work on stuff and my main computer (which is the only one that can run TF2) is not cooperating with me, so don't expect many updates from me anytime soon.

[ALL] Karaoke
[TF2] Intel Timer | Crabmod | Randomizer | Stopwatch | Crits 4 All
Theme97 is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-17-2009 , 13:00   Re: OnGameFrame GUI
Reply With Quote #7

It'll edit and reply.
FaTony is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 12-17-2009 , 13:12   Re: OnGameFrame GUI
Reply With Quote #8

I'd run all of these checks

Code:
IsValidEdict()
IsClientInGame() 
IsPlayerAlive()
__________________
Peoples Army is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-17-2009 , 14:36   Re: OnGameFrame GUI
Reply With Quote #9

There's no need to check IsValidEdict or IsPlayerAlive. The edict will always be valid for entities 1-MaxClients and you can display hud text to people who aren't alive/spectating with no problems.
bl4nk 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 20:55.


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