Espera te lo armo lo sacaré de mi antiguo zp y te lo paso editaré el POST.
EDIT: Aquí esta el code me testealo y me dices.
PHP Code:
#include <amxmodx>
#include <engine> // Para setear el string a la entidad y el nextthink
#include <dhudmessage>
// Variables que Uso.
new g_entCountDown, Float:g_flFreq, Float:g_flTimeLeft
public plugin_init()
{
register_plugin("ASD", "1.0", "DJHD!")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0") // Evento de cuando comienza la ronda.
}
public event_round_start() // Evento cuando comienza la ronda
MakeCountDown(10.0, 1.0) // 10 Segundos con una Frecuencia de 1.0 Segundos.
MakeCountDown(Float:flTimeleft, Float:flFrequency = 1.0) {
if(!g_entCountDown)
{
g_entCountDown = create_entity("info_target")
new const szClass[] = "countdown"
register_think(szClass, "CountDown")
entity_set_string(g_entCountDown, EV_SZ_classname, szClass)
}
g_flTimeLeft = flTimeleft
g_flFreq = flFrequency
entity_set_float(g_entCountDown, EV_FL_nextthink, get_gametime() + flFrequency)
call_think(g_entCountDown)
}
public CountDown(iEntity)
{
if(iEntity != g_entCountDown)
return;
set_dhudmessage(255, 255, 255, -1.0, 0.20, 1, 0.01, 1.0, 0.01, 0.01)
show_dhudmessage(0, "La ronda comienza en %d Segundos !!!", floatround(g_flTimeLeft))
new szTimer[32], iString[32]
num_to_word(floatround(g_flTimeLeft), szTimer, charsmax(szTimer))
formatex(iString, charsmax(iString), "fvox/%s", szTimer)
PlaySound(iString)
if (g_flTimeLeft)
{
entity_set_float(g_entCountDown, EV_FL_nextthink, get_gametime() + g_flFreq)
g_flTimeLeft -= g_flFreq
}
else
{
set_dhudmessage(255, 0, 0, -1.0, 0.17, 1, 0.01, 1.0, 0.01, 1.0)
show_dhudmessage(0, "Comienza la Ronda !!!")
}
}
// Plays a sound on clients
PlaySound(const sound[]) {
client_cmd(0, "spk ^"%s^"", sound)
}
Quote:
Originally Posted by BlackFur
Moda Fucker Le Di Click A Tu Link Alcanze A Sacarme El Audio :C
ON : podrias setear 1 variable en 10 luego llamar al task , en el task haces el len , y usas num_to_word y luego client_cmd spk o puedes precachear los 10 sonidos , y poner emit_sound y g_sound[variable]
|
No es necesario Precachear sonidos que viene con el cliente ademas que solamente le estas haciendo que lo reproduzca.
__________________