Raised This Month: $ Target: $400
 0% 

Clearing the hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Infest
Member
Join Date: Mar 2005
Old 09-14-2006 , 02:37   Clearing the hud
Reply With Quote #1

Hey, I'm having some trouble with figuring out how to clear a hud message after 5 seconds. What I basically need is for a piece of code that will format the old chat_msg's after 5 seconds. Here's the code:

Code:
public show_chat(){     new out[600]     if(get_cvar_num("sv_chat") == 1) {     format(out,599,"Chat:^n%s^n%s^n%s^n%s^n%s",chat_1,chat_2,chat_3,chat_4,chat_5)     set_hudmessage(g_Colours[2][0], g_Colours[2][1], g_Colours[2][2], 0.01, 0.05, 0, 0.0, 99.9, 0.0, 0.0, 3)     show_hudmessage(0, "%s",out)     }else{     format(out,599,"Hud Chat is currently Disabled")     set_hudmessage(g_Colours[1][0], g_Colours[1][1], g_Colours[1][2], 0.01, 0.05, 0, 0.0, 99.9, 0.0, 0.0, 3)     show_hudmessage(0, "%s",out)     }         }
Infest is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-14-2006 , 03:29   Re: Clearing the hud
Reply With Quote #2

use the function set_task()
Description
set_task - Calls function on specified time.
set_task ( Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0 )
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Infest
Member
Join Date: Mar 2005
Old 09-14-2006 , 03:33   Re: Clearing the hud
Reply With Quote #3

I'm sorry, but could you explain this a bit more. (I'm just getting into amxx coding)
Infest is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-14-2006 , 03:49   Re: Clearing the hud
Reply With Quote #4

set_task(5.0, "my_function")

my_function() {
//format your message here
}
"my_function" will be called after the time you set in set_task()
see more here
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Infest
Member
Join Date: Mar 2005
Old 09-14-2006 , 06:29   Re: Clearing the hud
Reply With Quote #5

Alright, I'll use the set_task command to loop the formating the hud for every 5 seconds. But what command can I use to format the message so it clears?
Infest is offline
Infest
Member
Join Date: Mar 2005
Old 09-14-2006 , 22:17   Re: Clearing the hud
Reply With Quote #6

Bump =\
Infest is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 09-14-2006 , 22:28   Re: Clearing the hud
Reply With Quote #7

Do not bump threads.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Infest
Member
Join Date: Mar 2005
Old 09-15-2006 , 01:09   Re: Clearing the hud
Reply With Quote #8

Sorry, I just need to know what to do =P
Infest is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 09-15-2006 , 08:12   Re: Clearing the hud
Reply With Quote #9

Hmmm if i remember there was something posted before about setting the hud message to -1..Maybe it was the channel?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
VEN
Veteran Member
Join Date: Jan 2005
Old 09-16-2006 , 07:46   Re: Clearing the hud
Reply With Quote #10

Quote:
But what command can I use to format the message so it clears?
Do you want to remove the message from the client's screen? Send the empty message or set the display time to 0.0, make sure that the channel is the same as for the original message.
VEN 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 00:37.


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