View Single Post
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 03-24-2013 , 20:57   Re: Evento dhudmessage
#5

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_entCountDownFloat:g_flFreqFloat: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.01.0// 10 Segundos con una Frecuencia de 1.0 Segundos.

MakeCountDown(Float:flTimeleftFloat:flFrequency 1.0) {    
    if(!
g_entCountDown)
    {
        
g_entCountDown create_entity("info_target")
        new const 
szClass[] = "countdown"
        
register_think(szClass"CountDown")
        
entity_set_string(g_entCountDownEV_SZ_classnameszClass)
    }
    
    
g_flTimeLeft flTimeleft
    g_flFreq 
flFrequency
    entity_set_float
(g_entCountDownEV_FL_nextthinkget_gametime() + flFrequency)
    
call_think(g_entCountDown)
}

public 
CountDown(iEntity)
{
    if(
iEntity != g_entCountDown)
        return;
    
    
set_dhudmessage(255255255, -1.00.2010.011.00.010.01)
    
show_dhudmessage(0"La ronda comienza en %d Segundos !!!"floatround(g_flTimeLeft))
    
    new 
szTimer[32], iString[32]
    
num_to_word(floatround(g_flTimeLeft), szTimercharsmax(szTimer))
    
formatex(iStringcharsmax(iString), "fvox/%s"szTimer)
    
    
PlaySound(iString)
    
    if (
g_flTimeLeft)
    {
        
entity_set_float(g_entCountDownEV_FL_nextthinkget_gametime() + g_flFreq)
        
g_flTimeLeft -= g_flFreq
    
}
    else
    {
        
set_dhudmessage(25500, -1.00.1710.011.00.011.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 View Post
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.
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.

Last edited by DJHD!; 03-24-2013 at 21:10.
DJHD! is offline
Send a message via MSN to DJHD!