AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hud message problem. (https://forums.alliedmods.net/showthread.php?t=100598)

ƒa†es™ 08-16-2009 05:09

Hud message problem.
 
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 ?.

ConnorMcLeod 08-16-2009 05:12

Re: Hud message problem.
 
%d : integer
%f : float


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


Of use %d with get_pcvar_NUM

ƒa†es™ 08-16-2009 05:50

Re: Hud message problem.
 
Quote:

Originally Posted by ConnorMcLeod (Post 902014)
%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

Arkshine 08-16-2009 06:09

Re: Hud message problem.
 
Use set_task with the "a" flags.

ƒa†es™ 08-16-2009 07:36

Re: Hud message problem.
 
Quote:

Originally Posted by Arkshine (Post 902054)
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.

Arkshine 08-16-2009 08:01

Re: Hud message problem.
 
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

ƒa†es™ 08-16-2009 08:13

Re: Hud message problem.
 
Quote:

Originally Posted by Arkshine (Post 902128)
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 )

Arkshine 08-16-2009 08:21

Re: Hud message problem.
 
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

One 08-16-2009 08:26

Re: Hud message problem.
 
Quote:

Originally Posted by ƒa†es™ (Post 902137)
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 ) )

}

ƒa†es™ 08-16-2009 09:30

Re: Hud message problem.
 
Quote:

Originally Posted by One (Post 902147)
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 ??


All times are GMT -4. The time now is 15:11.

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