Raised This Month: $ Target: $400
 0% 

Hud message problem.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 08-16-2009 , 05:09   Hud message problem.
Reply With Quote #1

Does anyone know what wrong with my hud message ?

PHP Code:
public ShowHUDid )
{
 if ( 
is_user_aliveid ) )
 {
  
set_hudmessage20010000.750.9201.01.10.00.0, -)
  
show_hudmessageid"Rampage Cooldown: %d"get_pcvar_floatCooldown ) )
 }
 else
 {
  
remove_taskid )
 }

My Cooldown is 35 seconds.

But in the game it show 1501201510

Can someone fix this ?.
__________________
ƒa†es™ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2009 , 05:12   Re: Hud message problem.
Reply With Quote #2

%d : integer
%f : float


You could use %.1f so you would whod only 1 decimal


Of use %d with get_pcvar_NUM
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 08-16-2009 , 05:50   Re: Hud message problem.
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
%d : integer
%f : float


You could use %.1f so you would whod only 1 decimal


Of use %d with get_pcvar_NUM
I change to this:

PHP Code:
public ShowHUDid )
{
 if ( 
is_user_aliveid ) )
 {
  
set_hudmessage20010000.750.9201.01.10.00.0, -)
  
show_hudmessageid"Rampage Cooldown: %d"get_pcvar_numCooldown ) )
 }

It work. however didn't work correctly..

The Cooldown stuck at 35 second.

So how do i make it like it is decreasing. ? like 5, 4, 3, 2, 1
__________________
ƒa†es™ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-16-2009 , 06:09   Re: Hud message problem.
Reply With Quote #4

Use set_task with the "a" flags.
__________________
Arkshine is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 08-16-2009 , 07:36   Re: Hud message problem.
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Use set_task with the "a" flags.
I did try using this :

PHP Code:
set_task1.0"ShowHUD"id__"a" )
 
public 
ShowHUDid )
{
 if ( 
is_user_aliveid ) )
 {
  
set_hudmessage200,2002000.750.9201.01.10.00.0, -)
  
show_hudmessageid"Rampage cooldown: %d"get_pcvar_numCooldown ) )
 }
 
 else
 {
  
remove_taskid )
 }

Still didn't work. the hudmessage didn't even appear.
__________________

Last edited by ƒa†es™; 08-16-2009 at 07:58.
ƒa†es™ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-16-2009 , 08:01   Re: Hud message problem.
Reply With Quote #6

If you use "a", you have to provide a number to say how many times you want to repeat. http://www.amxmodx.org/funcwiki.php?...task&go=search
__________________
Arkshine is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 08-16-2009 , 08:13   Re: Hud message problem.
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
If you use "a", you have to provide a number to say how many times you want to repeat. http://www.amxmodx.org/funcwiki.php?...task&go=search
I don't understand.

I want it remain when the user is alive.

I want it remove when the user is dead. remove_task( id )
__________________
ƒa†es™ is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-16-2009 , 08:26   Re: Hud message problem.
Reply With Quote #8

Quote:
Originally Posted by ƒa†es™ View Post
I don't understand.

I want it remain when the user is alive.

I want it remove when the user is dead. remove_task( id )
if ( is_user_alive( id ) )
{

set_task( 1.0, "ShowHUD")
}

public
ShowHUD( id )
{

set_hudmessage( 200,200, 200, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1 )
show_hudmessage( id, "Rampage cooldown: %d", get_pcvar_num( Cooldown ) )

}
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 08-16-2009 , 09:30   Re: Hud message problem.
Reply With Quote #9

Quote:
Originally Posted by One View Post
if ( is_user_alive( id ) )
{

set_task( 1.0, "ShowHUD")
}

public ShowHUD( id )
{
set_hudmessage( 200,200, 200, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1 )
show_hudmessage( id, "Rampage cooldown: %d", get_pcvar_num( Cooldown ) )

}
Sorry it didn't show the hudmessage forever. only once.

I try this :

PHP Code:
set_task1.0"ShowHUD"id__"a"get_pcvar_numCooldown ) )
 
public 
ShowHUDid )
{
 if ( 
is_user_aliveid ) )
 {
  
set_hudmessage2002002000.750.9201.01.10.00.0, -)
  
show_hudmessageid"Rampage cooldown: %d"get_pcvar_numCooldown) )
 }
 
 else
 { 
  
remove_taskid )
 }

It work. but the hudmessage cooldown show 35. How can i make it decrease like 5,4,3,2,1 ??

I also try this :

PHP Code:
  show_hudmessageid"Rampage cooldown: %f\d"get_pcvar_numCooldown ) - ( get_gametime( ) - g_cooldownid ] ) ) 
The hudmessage show alot of digt like 1512321511 ??

How can i make the set task forever ?

How can i make the digt less like 35,34,32,31 ??
__________________

Last edited by ƒa†es™; 08-16-2009 at 09:38.
ƒa†es™ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-16-2009 , 08:21   Re: Hud message problem.
Reply With Quote #10

Quote:
set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 )
Quote:
set_task( 1.0, "ShowHUD", id, _, _, "a", ? )
Quote:
"a" - Repeat task a specified number of times
__________________
Arkshine 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 15:11.


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