View Single Post
happy_2012
Senior Member
Join Date: Aug 2012
Old 04-08-2015 , 09:30   Re: zp_extra_addon_countdown HELP
Reply With Quote #4

Quote:
Originally Posted by XeOn Cp View Post
thanks bro, thank you very much, i have other plugins of infection countdown too(wich works with sounds) , just i posted my plugin because i like it, when MIX colored DHUD is coming, and counting. just if anyone can to add sounds to this plugin, it would be very nice. also i need it for ZPA and not for zp50...
Lol, okey!

PHP Code:
#include <amxmodx>

#define TASK_COUNT_DOWN 100
#define ID_TASK_COUNT (taskid - TASK_COUNT_DOWN)

const Float:HUD_COUNT_X = -1.0
const Float:HUD_COUNT_Y = -1.0

const HUD_COUNT_R 250
const HUD_COUNT_G 250
const HUD_COUNT_B 250

new Sounds_CountDown[][] =
{
    
"zombie_plague/countdown/ten.wav""zombie_plague/countdown/nine.wav""zombie_plague/countdown/eight.wav",
    
"zombie_plague/countdown/seven.wav""zombie_plague/countdown/six.wav""zombie_plague/countdown/five.wav",
    
"zombie_plague/countdown/four.wav""zombie_plague/countdown/three.wav""zombie_plague/countdown/two.wav",
    
"zombie_plague/countdown/one.wav""zombie_plague/countdown/start.wav"
}

new 
g_MsgCountDown;
new 
g_CurrentNumber;

public 
plugin_init()
{
    
register_plugin("[ZPA] Infection Countdown""1.0""funkyfresh")
    
    
register_event("TextMsg""event_restart_round""a""2&#Game_C""2&#Game_w")
    
register_event("HLTV""event_start_round""a""1=0""2=0")
    
    
g_MsgCountDown CreateHudSyncObj()
}

public 
plugin_precache()
{
    new 
iLoop;
    for(
iLoop 0iLoop sizeof Sounds_CountDowniLoop++)
        
precache_sound(Sounds_CountDown[iLoop])
}

public 
event_restart_round()
{
    
remove_task(TASK_COUNT_DOWN)    
}

public 
event_start_round()
{
    
g_CurrentNumber 11
    set_task
(2.0"task_count_down"TASK_COUNT_DOWN)
}

public 
task_count_down(taskid)
{    
    if(
g_CurrentNumber 1)
    {
        
g_CurrentNumber--
        
        
set_hudmessage(HUD_COUNT_RHUD_COUNT_GHUD_COUNT_BHUD_COUNT_XHUD_COUNT_X00.01.10.00.0, -2)
        
ShowSyncHudMsg(ID_TASK_COUNTg_MsgCountDown"Infection in %d seconds!"g_CurrentNumber)
        
        new 
NumberWord[21];
        
num_to_word(g_CurrentNumberNumberWordcharsmax(NumberWord))
        
        
client_cmd(0"spk zombie_plague/countdown/%s"NumberWord)
        
        
set_task(1.0"task_count_down"TASK_COUNT_DOWN)
    }
    else
    {
        
set_hudmessage(HUD_COUNT_RHUD_COUNT_GHUD_COUNT_BHUD_COUNT_XHUD_COUNT_X00.01.10.00.0, -2)
        
ShowSyncHudMsg(ID_TASK_COUNTg_MsgCountDown"Prepare for battle!")
        
        
client_cmd(0"spk zombie_plague/countdown/start")
    }
    
    return 
PLUGIN_CONTINUE;

__________________
Discord contacts:
I rarely look at private messages here, but I am very active on Discord!

Last edited by happy_2012; 04-08-2015 at 09:30.
happy_2012 is offline