Raised This Month: $ Target: $400
 0% 

[TUT][ZP] Cuenta Atras (Countdown)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Bernii
BANNED
Join Date: Feb 2013
Location: Weed Land *-*
Old 03-01-2013 , 04:40   [TUT][ZP] Cuenta Atras (Countdown)
#1

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:
----->
PHP Code:
TASK_COUNTDOWN 
// 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 (0ArraySize(sound_thunder); i++)
    {
        
ArrayGetString(sound_thunderibuffercharsmax(buffer))
        
engfunc(EngFunc_PrecacheSoundbuffer)
    } 
------>

PHP Code:
for (0ArraySize(sound_thunder); i++)
    {
        
ArrayGetString(sound_thunderibuffercharsmax(buffer))
        
engfunc(EngFunc_PrecacheSoundbuffer)
    }
        for (
0sizeof sound_countdowni++)
        
engfunc(EngFunc_PrecacheSoundsound_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(0CHAN_VOICEsound_countdown[countdown_timer], 1.0ATTN_NORM0PITCH_NORM);
        
set_hudmessage(17900, -1.00.2820.021.00.010.110);
        
        if (
countdown_timer 0)
        {
            
ShowSyncHudMsg(0g_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.
Attached Files
File Type: zip sound.zip (100.2 KB, 321 views)

Last edited by Bernii; 03-02-2013 at 13:12.
Bernii is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


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