Sign in to follow this  
Followers 0
Nevidimka

Countdown

2 posts in this topic

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "[ZP] Countdown"
#define VERSION "1.0"
#define AUTHOR "Nevidimka"

new countdown
new time_s

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public plugin_precache()
{
    precache_sound( "ne/10.wav" )
    precache_sound( "ne/9.wav" )
    precache_sound( "ne/8.wav" )
    precache_sound( "ne/7.wav" )
    precache_sound( "ne/6.wav" )
    precache_sound( "ne/5.wav" )
    precache_sound( "ne/4.wav" )
    precache_sound( "ne/3.wav" )
    precache_sound( "ne/2.wav" )
    precache_sound( "ne/1.wav" )
}

public event_round_start()
{
    set_task(4.0, "zombie_countdown")
    time_s = 10
    countdown = 9
}

public zombie_countdown()
{    
    new speak[ 10 ][] = { "ne/1.wav", "ne/2.wav", "ne/3.wav", "ne/4.wav", "ne/5.wav", "ne/6.wav", "ne/7.wav", "ne/8.wav", "ne/9.wav", "ne/10.wav" }

    emit_sound(0, CHAN_VOICE, speak[ countdown ], 1.0, ATTN_NORM, 0, PITCH_NORM )      
     --countdown
        
    set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10); 
    show_hudmessage(0, "/-----------------------------------\^n| Остлось до заражения: %i |^n\-----------------------------------/", time_s); 
    --time_s;
        
    if(time_s >= 1)
    {
        set_task(1.0, "zombie_countdown")
    }
} 

что мне изменить чтобы отсчет был не 10 секунд а 20. И чтобы музыка играла не с 20 секунды а с 10 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0