Добро пожаловать на форум, Гость, это ваша панель
  • Страница 1 из 1
  • 1
Помогите добавить звук в плагин c4cdvoice
KENTOS
Дата: Понедельник, 24.03.2014, 08:25 | Сообщение # 1
офлайн

  • Сообщения: 11
  • Награды: 0
  • Замечания:
 
Доброго вечера,помогите добавить звук в плагин.Звуки отсчета бомбы начинаются на 30 секунде из 35 как мне поставить еще 1 звук перед первым звуком допустим на 35 секунду,а дальше чтоб как было говорил?

/* 
changelog: 1.0
1.1 - Убран баг
 */

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "C4 CD Voice"
#define VERSION "1.1"
#define AUTHOR "c4timer_by_msk18"

new g_C4Timer

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("round_new", 2, "1=Round_Start");
register_logevent("round_end", 2, "1=Round_End");
register_logevent("round_end", 2, "1&Restart_Round_");

}

public round_new()
{
g_C4Timer = -1
remove_task(8038)
}

public round_end()
{
g_C4Timer = -1
remove_task(8038)
}
public bomb_planted(id)
{
g_C4Timer = get_cvar_num("mp_c4timer")
set_task(1.0, "bomb_voice", 8038, "", 0, "b")
}

public bomb_voice()
{
if (--g_C4Timer > 0)
{
switch(g_C4Timer)
{
case 1:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/1_sec")
case 2:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/2_sec")
case 3:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/3_sec")
case 4:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/4_sec")
case 5:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/5_sec")
case 6:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/6_sec")
case 7:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/7_sec")
case 8:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/8_sec")
case 9:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/9_sec")
case 10:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/10_sec")
case 20:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/20_sec")
case 30:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/30_sec")
}
}else
remove_task(8038)
}

public plugin_precache()
{
precache_generic ("sound/misc/c4timer_msk56/1_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/2_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/3_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/4_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/5_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/6_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/7_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/8_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/9_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/10_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/20_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/30_sec.mp3")
}

Добавлено (24.03.2014, 08:25)
---------------------------------------------
Добавил строчку "case 35:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/35_sec")" и precache_generic ("sound/misc/c4timer_msk56/35_sec.mp3") со звуковым файлом 35_sec.mp3. Фаил скачивает,но не воспроизводит.Правильно ли я сделал?

/* 
changelog: 1.0
1.1 - Убран баг
 */

#include <amxmodx>
#include <amxmisc>
#include <csx>

#define PLUGIN "C4 CD Voice"
#define VERSION "1.1"
#define AUTHOR "c4timer_by_msk18"

new g_C4Timer

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("round_new", 2, "1=Round_Start");
register_logevent("round_end", 2, "1=Round_End");
register_logevent("round_end", 2, "1&Restart_Round_");

}

public round_new()
{
g_C4Timer = -1
remove_task(8038)
}

public round_end()
{
g_C4Timer = -1
remove_task(8038)
}
public bomb_planted(id)
{
g_C4Timer = get_cvar_num("mp_c4timer")
set_task(1.0, "bomb_voice", 8038, "", 0, "b")
}

public bomb_voice()
{
if (--g_C4Timer > 0)
{
switch(g_C4Timer)
{
case 1:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/1_sec")
case 2:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/2_sec")
case 3:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/3_sec")
case 4:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/4_sec")
case 5:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/5_sec")
case 6:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/6_sec")
case 7:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/7_sec")
case 8:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/8_sec")
case 9:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/9_sec")
case 10:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/10_sec")
case 20:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/20_sec")
case 30:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/30_sec")
case 35:client_cmd(0, "mp3 play sound/misc/c4timer_msk56/35_sec")
}
}else
remove_task(8038)
}

public plugin_precache()
{
precache_generic ("sound/misc/c4timer_msk56/1_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/2_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/3_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/4_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/5_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/6_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/7_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/8_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/9_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/10_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/20_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/30_sec.mp3")
precache_generic ("sound/misc/c4timer_msk56/35_sec.mp3")
}


 
  • Страница 1 из 1
  • 1
Поиск: