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

count down


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-10-2020 , 16:22   count down
Reply With Quote #1

Hello
Can anyone give me a countdown?
Run 13 to 0 in each round
Comes with audio count with hud display
There are other plugins but I want one simple thing
__________________
amirwolf is offline
drakunovu6
Member
Join Date: Sep 2017
Old 09-12-2020 , 20:01   Re: count down
Reply With Quote #2

Here it is, also you can change the countdown number by changing the cvar "countdown_time"

PHP Code:
#include <amxmodx>
#include <amxmisc>

new cvar_countdowng_countdowng_countdown_hud;

enum (+= 100)
{
    
TASK_COUNTDOWN
}

public 
plugin_init()
{
    
register_plugin("Countdown each round""1.0""Drakunovu");
    
register_event("HLTV""start_countdown""a""1=0""2=0");
    
    
cvar_countdown register_cvar("countdown_time""13");

    
g_countdown_hud CreateHudSyncObj();
}

public 
start_countdown()
{
    
remove_task(TASK_COUNTDOWN);
    
g_countdown get_pcvar_num(cvar_countdown);
    
set_task(1.0"countdown"TASK_COUNTDOWN__"b");
}

public 
countdown()
{
    
set_hudmessage(02550, -1.00.2820.021.00.010.110);
    
ShowSyncHudMsg(0g_countdown_hud"The round will start in %d"g_countdown);

    new 
number[20];
    
num_to_word(g_countdownnumbercharsmax(number));
    
client_cmd(0"spk ^"fvox/%s^""number); // you can change the sound right here.

    
g_countdown--;

    if (
g_countdown 0)
    {
        
remove_task(TASK_COUNTDOWN);

        
// here your code to happen after the countdown is over.

        
return;
    }


Last edited by drakunovu6; 09-13-2020 at 10:26. Reason: forgot to add CreateHudSyncObj();
drakunovu6 is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-13-2020 , 01:21   Re: count down
Reply With Quote #3

thank you
__________________
amirwolf is offline
Reply


Thread Tools
Display Modes

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 22:18.


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