Raised This Month: $32 Target: $400
 8% 

[REQ] Play specific sound when only 1 human left.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hammerfallerz
Senior Member
Join Date: Feb 2008
Old 09-19-2010 , 12:13   [REQ] Play specific sound when only 1 human left.
Reply With Quote #1

Good day.

I would to request a plugin which plays one specific sound (once) to all alive players when there's only 1 human left (only when it's an infection or swarm mode) and total players count is more than 10.

Thanks.
Hammerfallerz is offline
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
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-19-2010 , 13:53   Re: [REQ] Play specific sound when only 1 human left.
Reply With Quote #3

You can simply use this:
Code:
#include <amxmodx> #include <zombieplague> // Minimum players required for the sound to be played #define MIN_PLAYERS 10 // Place the sound you want to be heard by every one new const sound[] = "zombie_plague/survivor.wav" new g_can_play_sound, g_max_players public plugin_init() {     register_plugin("[ZP] Addon: Last Human Play Sound", "1.0", "@bdul!")         g_max_players = get_maxplayers() } public plugin_precache() {     // Precache our sound     precache_sound(sound) } public zp_round_started(gamemode)     if (gamemode == MODE_SWARM || gamemode == MODE_INFECTION)         g_can_play_sound = true public zp_round_ended(winteam)     g_can_play_sound = false public zp_user_last_human(id) {     if (!zp_get_user_survivor(id) && g_can_play_sound && fn_get_connected() >= MIN_PLAYERS)     {         static id         for (id = 1; id <= g_max_players; id++)             if (is_user_alive(id)) client_cmd(0, "spk ^"%s^"", sound)     } } fn_get_connected() {     static iAlive, id     iAlive = 0         for (id = 1; id <= g_max_players; id++)     {         if (is_user_connected(id))             iAlive++     }         return iAlive; }
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
vaan123
Veteran Member
Join Date: Sep 2009
Location: Kuwait
Old 09-19-2010 , 14:51   Re: [REQ] Play specific sound when only 1 human left.
Reply With Quote #4

good idea


@abdul

could you make the zombies hear the sound too?



EDIT: @abdul: do you have steam?
__________________


Last edited by vaan123; 09-19-2010 at 14:56.
vaan123 is offline
Send a message via MSN to vaan123 Send a message via Yahoo to vaan123 Send a message via Skype™ to vaan123
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-19-2010 , 14:57   Re: [REQ] Play specific sound when only 1 human left.
Reply With Quote #5

Quote:
Originally Posted by vaan123 View Post
good idea


@abdul

could you make the zombies hear the sound too?



EDIT: do you have steam?
Zombies will here it
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
vaan123
Veteran Member
Join Date: Sep 2009
Location: Kuwait
Old 09-19-2010 , 15:02   Re: [REQ] Play specific sound when only 1 human left.
Reply With Quote #6

Quote:
Originally Posted by abdul-rehman View Post
Zombies will here it
never mind then.

keep up the good work =]
__________________

vaan123 is offline
Send a message via MSN to vaan123 Send a message via Yahoo to vaan123 Send a message via Skype™ to vaan123
Reply



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 02:23.


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