View Single Post
st6315
Member
Join Date: Apr 2010
Old 09-19-2010 , 13:17   Re: [REQ] Play specific sound when only 1 human left.
Reply With Quote #2

Well, hope this works......
PHP Code:
#include <amxmodx>
#include <csx>
#include <amxmisc>
#include <zombieplague>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

const TASK_ID 2003;
new 
players[32], num;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""event_round_start""a""1=0""2=0");
}
public 
plugin_precache()
{
    
precache_sound("zombie_plague/nemesis2.wav");
}

public 
event_round_start()
{
    
set_task(4.0"lastHuman"TASK_ID);
}

public 
lastHuman()
{
    if(
zp_get_human_count()==1)
    {
        if(!
zp_is_survivor_round())
        {
            
get_players(playersnum"ch");
            for (new 
inumi++)
            {
                if(
is_user_alive(players[i]))
                    
client_cmd(players[i], "spk %s","zombie_plague/nemesis2.wav");
            }
        }
        
remove_task(TASK_ID);
    }
    else
    {
        
set_task(0.5"lastHuman"TASK_ID);
    }

st6315 is offline