This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Help with HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 03:56   Help with HUD
Reply With Quote #1

I need to display a HUD message which stays permanently on the screen and will update automatically, when some variable's value changes.
Example Plugin:Show Admins Online
I went through its source and found sync-hud, but I'm new to scripting and din't get the mechanism to use it.
Also it had some register_think value which I don't understand yet.
Tried to search about sync-hud but couldn't find any useful info.
Can someone explain how the sync-hud works?
connoisseur is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-19-2013 , 05:24   Re: Help with HUD
Reply With Quote #2

What you try to do?
__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 06:04   Re: Help with HUD
Reply With Quote #3

Quote:
Originally Posted by K1d0x View Post
What you try to do?
I'm trying to display the number of alive players in a HUD message that stays permanently, and updates instantly when the number of alive players change.
connoisseur is offline
_Pro_
Senior Member
Join Date: Mar 2012
Location: Argentina
Old 07-19-2013 , 07:53   Re: Help with HUD
Reply With Quote #4

The flag "b" is to be replayed forever, you can stop de task seting an ID and make remove_task(ID)
PHP Code:
set_task(1.0"PermanentHud"0__"b")

public 
PermanentHud()
{
    
set_hudmessage(25500, -1.00.3506.01.00.00.0)
    
show_hudmessage(0"Players Alive: %d"cts)

Sorry for my bad english :C
_Pro_ is offline
Send a message via MSN to _Pro_ Send a message via Skype™ to _Pro_
Old 07-19-2013, 08:09
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: troll, or posting random confusing code, or posting for posts count
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 10:05   Re: Help with HUD
Reply With Quote #5

Quote:
Originally Posted by _Pro_ View Post
The flag "b" is to be replayed forever, you can stop de task seting an ID and make remove_task(ID)
PHP Code:
set_task(1.0"PermanentHud"0__"b")

public 
PermanentHud()
{
    
set_hudmessage(25500, -1.00.3506.01.00.00.0)
    
show_hudmessage(0"Players Alive: %d"cts)

Sorry for my bad english :C
Thanks for the idea, but you see, I already know this way.
I was actually looking forward to learn the sync-hud method.
Plus this one includes set_task which will be CPU consuming.
Sync-hud method, which I observed didn't use set_task.

Quote:
Originally Posted by LordOfNothing View Post
xLoL , You dont need to determinate the number of players ? just put %d an cts and thats all ??
No need of that, I have already coded that part. I was just searching for a way to display permanently.
connoisseur is offline
AwesomeMan
Member
Join Date: Jun 2013
Old 07-19-2013 , 10:15   Re: Help with HUD
Reply With Quote #6

Code:
public plugin_init()
{
	register_event("HLTV", "asd", "a", "1=0", "2=0"); 
	RegisterHam(Ham_Killed, "player", "asd", true); 
        RegisterHam(Ham_Spawn, "player", "asd", 1) 
}
public asd()
{
	set_hudmessage(255, 255, 255, -1,0 0.00, 0, 6.0, 9999.0)
	show_hudmessage(0, "Admins Online: %d", adminonline)
This is one way, it will update everytime someone dies, new round and when someone spawns. This might not be the best way and I didn't test it if it will work.
AwesomeMan is offline
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 10:25   Re: Help with HUD
Reply With Quote #7

Quote:
Originally Posted by AwesomeMan View Post
This is one way, it will update everytime someone dies, new round and when someone spawns. This might not be the best way and I didn't test it if it will work.
Thanks for that idea, but again I'm trying to learn the "sync-hud" way here.
Please suggest a display using sync-hud only.
connoisseur is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-19-2013 , 10:48   Re: Help with HUD
Reply With Quote #8

PHP Code:
SyncHudMessage(id255100501.01.0006.0__3"Alive Players: %i"players
__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
connoisseur
Senior Member
Join Date: Jan 2012
Old 07-19-2013 , 12:24   Re: Help with HUD
Reply With Quote #9

Quote:
Originally Posted by K1d0x View Post
PHP Code:
SyncHudMessage(id255100501.01.0006.0__3"Alive Players: %i"players
Some explanation would be great.
There was more sync hud stuff which i saw, than this statement.
And more importantly how to use it to update the value automatically
connoisseur is offline
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-19-2013 , 12:28   Re: Help with HUD
Reply With Quote #10

Why you want to use synchud and you don't want to use set_hudmessage?
__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
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 11:15.


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