AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   zp_extra_addon_countdown HELP (https://forums.alliedmods.net/showthread.php?t=261161)

XeOn Cp 04-07-2015 04:37

zp_extra_addon_countdown HELP
 
1 Attachment(s)
hi guys, i'm using this countdown infection, but Sounds aren't working... can you help me?

Attachment 143930

happy_2012 04-08-2015 09:19

Re: zp_extra_addon_countdown HELP
 
1 Attachment(s)
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/..."

XeOn Cp 04-08-2015 09:27

Re: zp_extra_addon_countdown HELP
 
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...

happy_2012 04-08-2015 09:30

Re: zp_extra_addon_countdown HELP
 
Quote:

Originally Posted by XeOn Cp (Post 2283467)
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;



XeOn Cp 04-08-2015 13:44

Re: zp_extra_addon_countdown HELP
 
1 Attachment(s)
i just solved problem with your .sma
thanks
here it is: Attachment 143954


All times are GMT -4. The time now is 02:27.

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