AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make the HUD always displayed and updated? (https://forums.alliedmods.net/showthread.php?t=188153)

a8966338 06-23-2012 01:16

How to make the HUD always displayed and updated?
 
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <fun>


public plugin_init()
{
register_plugin("testing""1.0""Testing")
register_clcmd("say /test""test")
}


public 
test(id)
{
new 
money cs_get_user_money(id)
if( 
money >= 0)
{
set_hudmessage(255000.360.5406.012.0)
show_hudmessage(id"%d"money)



}
else
{
client_print(idprint_chat"you don't have money")


}


How to make the HUD always displayed and updated?
I hope it is always displayed on the screen
Not for some time to disappear
If the money to change, how to make the HUD also follow the change?

hyphen 06-23-2012 02:04

Re: How to make the HUD always displayed and updated?
 
You can set a timer to start the hud again & again just after its timeout.

a8966338 06-23-2012 02:12

Re: How to make the HUD always displayed and updated?
 
Quote:

Originally Posted by hyphen (Post 1734296)
You can set a timer to start the hud again & again just after its timeout.

How can I set?
Can you help me?
and how can always show?

hyphen 06-23-2012 02:46

Re: How to make the HUD always displayed and updated?
 
Actually Im not very sure which parameter of set_hudmessage() actually responsible for message time to stay on screen. Here is the function signature.

set_hudmessage ( red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, effects=0, Float:fxtime=6.0, Float:holdtime=12.0, Float:fadeintime=0.1, Float:fadeouttime=0.2, channel=4 )

If anyone here can point this out that will be helpful, and then after elapsing that time just start a timer to start this set_hudmessage again and continue this until player disconnects.

a8966338 06-23-2012 03:20

Re: How to make the HUD always displayed and updated?
 
Quote:

Originally Posted by hyphen (Post 1734313)
Actually Im not very sure which parameter of set_hudmessage() actually responsible for message time to stay on screen. Here is the function signature.

set_hudmessage ( red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, effects=0, Float:fxtime=6.0, Float:holdtime=12.0, Float:fadeintime=0.1, Float:fadeouttime=0.2, channel=4 )

If anyone here can point this out that will be helpful, and then after elapsing that time just start a timer to start this set_hudmessage again and continue this until player disconnects.

oH! Turned out to be
How to make it real-time updates
Can you give me sma?
SOR.. my sma not very good
and my English else not very good
Because I am form Taiwan
but my TChinese is good :)

<VeCo> 06-23-2012 07:11

Re: How to make the HUD always displayed and updated?
 
Make an infinite task that will show the HUD to all players with a loop.

a8966338 06-23-2012 08:28

Re: How to make the HUD always displayed and updated?
 
Quote:

Originally Posted by <VeCo> (Post 1734399)
Make an infinite task that will show the HUD to all players with a loop.

How can I make an infinite task?
Excuse me ,can you do the demonstration?

GordonFreeman (RU) 06-23-2012 08:42

Re: How to make the HUD always displayed and updated?
 
Code:
set_task(1.0,"myawesometask",id,.flags="b")

Doc-Holiday 06-23-2012 09:40

Creat a sync hud and put a long ass timer on it lol... Then call the hud function when you want it updated

With what your trying to do the task works better

a8966338 06-24-2012 00:35

Re: How to make the HUD always displayed and updated?
 
Quote:

Originally Posted by GordonFreeman (RU) (Post 1734426)
Code:
set_task(1.0,"myawesometask",id,.flags="b")

very thank :)


All times are GMT -4. The time now is 06:14.

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