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

zp_extra_addon_countdown HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XeOn Cp
Senior Member
Join Date: Jan 2014
Old 04-07-2015 , 04:37   zp_extra_addon_countdown HELP
Reply With Quote #1

hi guys, i'm using this countdown infection, but Sounds aren't working... can you help me?

zp_extra_addon_countdown.sma
XeOn Cp is offline
happy_2012
Senior Member
Join Date: Aug 2012
Old 04-08-2015 , 09:19   Re: zp_extra_addon_countdown HELP
Reply With Quote #2

I used to use this plugin before, but now that I have learned coding I created my very own infection count-down plugin using the same sound resources given with this plugin you gave us. Even though I never intended to release my private works of my servers, I still like to help. There you go!

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

#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("[ZP] Infection Countdown"ZP_VERSION_STRING"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;

Add the sound resources in the proper directory of the code "zombie_plague/countdown/..."
Attached Files
File Type: zip countdown.zip (194.1 KB, 49 views)
__________________
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:28. Reason: Added resource files & code updated
happy_2012 is offline
XeOn Cp
Senior Member
Join Date: Jan 2014
Old 04-08-2015 , 09:27   Re: zp_extra_addon_countdown HELP
Reply With Quote #3

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...
XeOn Cp is offline
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
XeOn Cp
Senior Member
Join Date: Jan 2014
Old 04-08-2015 , 13:44   Re: zp_extra_addon_countdown HELP
Reply With Quote #5

i just solved problem with your .sma
thanks
here it is: zp_extra_addon_countdown.sma

Last edited by XeOn Cp; 04-08-2015 at 14:01.
XeOn Cp 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 02:31.


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