AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Countdown (https://forums.alliedmods.net/showthread.php?t=206118)

ironskillz1 01-18-2013 16:45

Countdown
 
i made a little countdown
its doesnt working so well
1. the numbers is on each other but the countdown works
2. its flashing when other hud message on the screen comes up ? can i some how fix that?

and how can i add so when the countdown is on 0 i can set a hud message
Code:

public CountDown()
{
 set_task( 3.0, "CountDown1")
}
public CountDown1()
{
 g_iCountTime = CountSeconds;
 set_task( 1.0, "Count" , _ , _ , _ , "a" , g_iCountTime );
}
public Count()
{       
 set_hudmessage ( 10, 10, 255, -1.0, 0.35, 0, 0.1, 5.0, 0.1, 0.1, -1 ) 
 show_hudmessage( 0 , "[%d] Seconds left to hide!" , g_iCountTime-- );
 
}


Bos93 01-18-2013 18:45

Re: Countdown
 
http://www.amxmodx.org/funcwiki.php?...sage&go=search

Quote:

1. the numbers is on each other but the countdown works
big hold time.

set_hudmessage ( 10, 10, 255, -1.0, 0.35, 0, 0.1, 5.0, 0.1, 0.1, -1 )
--->
set_hudmessage ( 10, 10, 255, -1.0, 0.35, 0, 0.1, 1.0, 0.1, 0.1, -1 )

Quote:

2. its flashing when other hud message on the screen comes up ? can i some how fix that?
use CreateHudSyncObj() or dhud

Blizzard_87 01-19-2013 02:00

Re: Countdown
 
PHP Code:

#include <amxmodx>

#define TASKID  1996
#define SECONDS 10

new iSeconds

public plugin_init()
{
    
register_plugin"Countdown Example""1.0""Wrecked" )
    
    
register_logevent"LogEventRoundStart"2"1=Round_Start" )
}

public 
LogEventRoundStart()
{
    if( 
task_existsTASKID ) )
        
remove_taskTASKID )
        
    
iSeconds SECONDS
    set_task
1.0"TaskShowCountdown"TASKID__"a"SECONDS )
}

public 
TaskShowCountdown()
{
    
set_hudmessage1201201200.500.5000.10.80.10.1, -)
    
show_hudmessage0"Seconds Remaining: %i"iSeconds-- )


this is code from this thread.. => http://forums.alliedmods.net/showthread.php?t=130616


hope it helps.


All times are GMT -4. The time now is 13:42.

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