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

How to make hudmessage not go away?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 04-09-2010 , 04:57   How to make hudmessage not go away?
Reply With Quote #1

Hi, im tryign to display a users kills with a hud message and i wonder how do i make it not go away?

Code:
PHP Code:
    set_hudmessage(02550, -1.00.8806.030.0)
    
show_hudmessage(iPlayer"Kills: %i"userKills[iPlayer]) 
The code above makes the hudmessage go away after 30 seconds.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 04-09-2010 , 05:59   Re: How to make hudmessage not go away?
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=28

Set the duration
__________________
VMAN is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 04-09-2010 , 06:07   Re: How to make hudmessage not go away?
Reply With Quote #3

yeh but i dont want the message to go away until the map end or possibly round end.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 04-09-2010 , 07:48   Re: How to make hudmessage not go away?
Reply With Quote #4

The solution is simple. When it's about to "go away" display it again.

The simplest way to code that is to use set_task.
PHP Code:
public start_displaying(){
    
set_task(1.0"display_msg"2356__"b"
    
//function display_msg will be called every second
}

public 
display_msg(){
    
//this function will display hud message that lasts 1 second every time it's called
    
set_hudmessage(02550, -1.00.8806.01.0)
    
show_hudmessage(iPlayer"Kills: %i"userKills[iPlayer])

There is something better than set_task described here, but it's harder to use.
__________________
Impossible is Nothing
Sylwester is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 04-10-2010 , 22:57   Re: How to make hudmessage not go away?
Reply With Quote #5

I will try that, but what shud i do with "start_displaying"?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-10-2010 , 23:51   Re: How to make hudmessage not go away?
Reply With Quote #6

Quote:
Originally Posted by NiQu View Post
I will try that, but what shud i do with "start_displaying"?
Call that when you want to begin displaying the "permanent" HUD.

Here's some extra info that may help you...

If you want to stop displaying the HUD at any time, call remove_task( 2356 ).
To check if this HUD is being displayed, use task_exists( 2356 ).

If you want to display the HUD for only X seconds while allowing it to be updated w\ new data each second, pass the "a" flag instead of "b" and specify the number of seconds.

For example, to show the above HUD for only 30 seconds:
set_task( 1.0 , "display_msg" , 2356 , _ , _ , "a" , 30 );
__________________

Last edited by Bugsy; 04-11-2010 at 00:02.
Bugsy is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 04-11-2010 , 00:46   Re: How to make hudmessage not go away?
Reply With Quote #7

alright, thanks ill test as soon as ive rewritten my code.

Edit: i think i want to thank you.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Old 04-13-2010, 07:44
JaGareN
This message has been deleted by JaGareN. Reason: Bugsy said, its the worst way....
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-13-2010 , 07:47   Re: How to make hudmessage not go away?
Reply With Quote #8

Yes, but then you have 10+ HUD messages per second overlapping each other.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-13-2010 , 08:21   Re: How to make hudmessage not go away?
Reply With Quote #9

Quote:
Originally Posted by JaGareN View Post
You can write it in the Client_prethink and it will never go off again.
Please do not try to help people if you don't know what you're talking about. PreThink is probably the worst way to do this. If you feel it is better, please explain why.
__________________
Bugsy is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 04-13-2010 , 08:27   Re: How to make hudmessage not go away?
Reply With Quote #10

..

shud i use set_task or client_PreThink !?
I tested both and prethink so far works best.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu 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 04:30.


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