Probado en versiones ZP 4.2, 4.3, ZPA
Creditos a L//
// Bueno empecemos.
// Creamos la variable Countdown_Timer para definir el tiempo de cuenta.
PHP Code:
new countdown_timer
// Y ahora la constante de los sonidos.
PHP Code:
new const sound_countdown[][] =
{
"fvox/biohazard_detected.wav",
"zombie_plague/one.wav",
"zombie_plague/two.wav",
"zombie_plague/three.wav",
"zombie_plague/four.wav",
"zombie_plague/five.wav"
}
// Ahora nos vamos a // Task offsets.
- Debajo de
PHP Code:
TASK_AMBIENCESOUNDS,
// Agregamos:
----->
// Bien ja queda poco
Ahora nos vamos a
PHP Code:
public plugin_precache
- Y en la parte de // Custom sounds. Alfinal del ultimo for agregamos otro.
PHP Code:
for (i = 0; i < ArraySize(sound_thunder); i++)
{
ArrayGetString(sound_thunder, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
------>
PHP Code:
for (i = 0; i < ArraySize(sound_thunder); i++)
{
ArrayGetString(sound_thunder, i, buffer, charsmax(buffer))
engfunc(EngFunc_PrecacheSound, buffer)
}
for (i = 0; i < sizeof sound_countdown; i++)
engfunc(EngFunc_PrecacheSound, sound_countdown[i])
// Ahora vamos a [Main Events] y buscamos el public // Event Round Start
- Y debajo del { agregamos
PHP Code:
// Prevent multiples countdowns
remove_task(TASK_COUNTDOWN);
countdown_timer = 5 ------> Son los segundos
// 4.0 + 2.0 de delay adicional
set_task(6.0, "countdown", TASK_COUNTDOWN)
// Por ultimo, alfinal de todo el ZP agregamos.
PHP Code:
public countdown()
{
if (countdown_timer >= 0)
{
emit_sound(0, CHAN_VOICE, sound_countdown[countdown_timer], 1.0, ATTN_NORM, 0, PITCH_NORM);
set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
if (countdown_timer > 0)
{
ShowSyncHudMsg(0, g_MsgSync3, "-------------------------^n\
Modo En %i^n\
-------------------------", countdown_timer);
}
}
--countdown_timer;
if (countdown_timer > 0)
{
set_task(1.0, "countdown", TASK_COUNTDOWN);
}
else
{
remove_task(TASK_COUNTDOWN);
}
}
Eso es todo amigos.