AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ultimate Sounds (https://forums.alliedmods.net/showthread.php?t=194971)

kenx1998 09-02-2012 07:14

Ultimate Sounds
 
PHP Code:

///////////////////////////////////////////////////
//  AMXMOD[X]                                    //
//   ::Ultimate sounds::                         //
//    by Hephaistos ([email protected])       //
//    edited by Dizzy ([email protected])   //
//                                               //
// cvar:                                         //
//  streak_mode < flags >                        //
//  "a" - messages                               //
//  "b" - sounds                                 //
//                                               //
//  kniff_mode < flags >                         //
//  "a" - messages                               //
//  "b" - sounds                                 //
//                                               //
//  hs_mode < flags >                            //
//  "a" - messages                               //
//  "b" - sounds                                 //
//                                               //
//  lastman_mode < flags >                       //
//  "a" - messages                               //
//  "b" - hp                                     //
//  "c" - sounds                                 //
///////////////////////////////////////////////////

#include <amxmodx>

#define KNIFFMESSAGES 4
#define LEVELS 7
#define MESSAGESNOHP 4
#define MESSAGESHP 4

new kills[33] = {0,...};
new 
deaths[33] = {0,...};
new 
alone_ann 0
new levels[7] = {3579101315};

new 
stksounds[7][] = {
"misc/multikill",
"misc/ultrakill",
"misc/monsterkill",
"misc/killingspree",
"misc/rampage",
"misc/holyshit",
"misc/godlike"};

new 
stkmessages[7][] = {
"%s: Multi-Kill!",
"%s: Ultra-Kill!",
"%s: Monster-Kill!",
"%s: Killing Spree!",
"%s: Rampage!",
"%s: Holy Shit!",
"%s: Godlike!"};


new 
kniffmessages[KNIFFMESSAGES][] = {
"%s Sliced And Diced %s!",
"%s Shanked %s!",
"%s Pulled A Knife On %s!",
"%s Knived %s!"}

new 
messagesnohp[MESSAGESNOHP][] = {
"%i terrorist vs %i CT^n%s: Now All Depends On You!",
"%i terrorist vs %i CT^n%s: I Hope You Still Have A Healthpack.",
"%i terrorist vs %i CT^n%s: All Your Teammates Were Killed. Good Luck!",
"%i terrorist vs %i CT^n%s: Now You Are Alone. Have Fun!"}

new 
messageshp[MESSAGESHP][] = {
"%i terrorist vs %i CT^n%s (%i hp): Now All Depend On You!",
"%i terrorist vs %i CT^n%s (%i hp): I Hope You Still Have A Healthpack.",
"%i terrorist vs %i CT^n%s (%i hp): All Your Teammates Were Killed. Good Luck!",
"%i terrorist vs %i CT^n%s (%i hp): Now You Are alone. Have Fun!"}

get_streak()
{
    new 
streak[3]
    
get_cvar_string("streak_mode",streak,2)
    return 
read_flags(streak)
}

public 
death_event(id)
{
    new 
streak get_streak()

    if ((
streak&1) || (streak&2))
    {
            new 
killer read_data(1);
            new 
victim read_data(2);

            
kills[killer] += 1;
            
kills[victim] = 0;
            
deaths[killer] = 0;
            
deaths[victim] += 1;

            for (new 
0LEVELSi++)
        {
                if (
kills[killer] == levels[i])
            {
                        
announce(killeri);
                        return 
PLUGIN_CONTINUE;
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}

announce(killerlevel)
{
    new 
streak get_streak()

    if (
streak&1)
    {
            new 
name[32];

           
get_user_name(killername32);
        
set_hudmessage(01002000.050.6520.026.00.010.12);
        
show_hudmessage(0stkmessages[level], name);
    }

    if (
streak&2){
            
client_cmd(0"spk %s"stksounds[level]);
    }
}

public 
reset_hud(id)
{
    new 
streak get_streak()

    if (
streak&1)
    {

        if (
kills[id] > levels[0])
        {
                
client_print(idprint_chat
            
"* You are on a killstreak with %d kills."kills[id]);

        }

        else if (
deaths[id] > 1)
        {
            
client_print(idprint_chat
            
"* Take care, you are on a deathstreak with %d deaths in a row."deaths[id]);
        }
    }
}

public 
client_connect(id)
{
    new 
streak get_streak()

    if ((
streak&1) || (streak&2))
    {
        
kills[id] = 0;
        
deaths[id] = 0;
    }
}

public 
knife_kill()
{
    new 
kniffmode[4
    
get_cvar_string("kniff_mode",kniffmode,4
    new 
kniffmode_bit read_flags(kniffmode)

    if (
kniffmode_bit 1)
    {
        new 
killer_id read_data(1)
        new 
victim_id read_data(2)
        new 
killer_name[33], victim_name[33]

        
get_user_name(killer_id,killer_name,33)
        
get_user_name(victim_id,victim_name,33)


        
set_hudmessage(2001000, -1.00.3006.06.00.50.151)
        
show_hudmessage(0,kniffmessagesrandom_num(0,KNIFFMESSAGES-1) ],killer_name,victim_name)
    }

    if (
kniffmode_bit 2)
    {
        
client_cmd(0,"spk misc/humiliation")
       }
}


public 
roundend_msg(id)

    
alone_ann 0

public death_msg(id)
{

    new 
lmmode[8
    
get_cvar_string("lastman_mode",lmmode,8
    new 
lmmode_bit read_flags(lmmode)

    new 
players_ct[32], players_t[32], ictitelast
    get_players
(players_ct,ict,"ae","CT")   
    
get_players(players_t,ite,"ae","TERRORIST")   

    if (
ict==1&&ite==1)
    {
        new 
name1[32], name2[32]
        
get_user_name(players_ct[0],name1,32)
        
get_user_name(players_t[0],name2,32)
        
set_hudmessage(2001000, -1.00.3006.06.00.50.151)

        if (
lmmode_bit 1)
        {
            if (
lmmode_bit 2)
            {
                
show_hudmessage(0,"%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct[0]),name2,get_user_health(players_t[0]))
            }

            else
            {
                
show_hudmessage(0,"%s vs. %s",name1,name2)
            }

            if (
lmmode_bit 4)
            {
                
client_cmd(0,"spk misc/maytheforce")
            }
        }
    } 
    else
{   
    if (
ict==1&&ite>1&&alone_ann==0&&(lmmode_bit 4))
    {
        
last=players_ct[0]
        
client_cmd(last,"spk misc/oneandonly")
    }

    else if (
ite==1&&ict>1&&alone_ann==0&&(lmmode_bit 4))
    {
        
last=players_t[0]
        
client_cmd(last,"spk misc/oneandonly")
    }

    else
    {
        return 
PLUGIN_CONTINUE
    
}
    
alone_ann last
    
new name[32]   
    
get_user_name(last,name,32)

    if (
lmmode_bit 1)
    {
        
set_hudmessage(2001000, -1.00.3006.06.00.50.151)

        if (
lmmode_bit 2)
        {
            
show_hudmessage(0,messageshprandom_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last))
        }

        else
        {
            
show_hudmessage(0,messagesnohprandom_num(0,MESSAGESNOHP-1) ],ite ,ict ,name )
        }
    }

    if (
lmmode_bit 4)
    {
        
client_cmd(last,"spk misc/maytheforce")
    }
}
    return 
PLUGIN_CONTINUE   
}


public 
hs()
{
    new 
hsmode[4
    
get_cvar_string("hs_mode",hsmode,4
    new 
hsmode_bit read_flags(hsmode)

    if (
hsmode_bit 1)
    {
    new 
killer_id read_data(1)
    new 
victim_id read_data(2)
    new 
victim_name[33]

    
get_user_name(victim_id,victim_name,33)

    
set_hudmessage(2001000, -1.00.3003.03.00.150.151)
    
show_hudmessage(killer_id,"::HEADSHOT::^nYou Owned %s !!",victim_name)
    }

    if (
hsmode_bit 2)
    {
        
client_cmd(0,"spk misc/headshot")
    }
}

public 
plugin_precache()
{
    
precache_sound("misc/monsterkill.wav")
    
precache_sound("misc/godlike.wav")
    
precache_sound("misc/headshot.wav")
    
precache_sound("misc/humiliation.wav")
    
precache_sound("misc/killingspree.wav")
    
precache_sound("misc/multikill.wav")
    
precache_sound("misc/ultrakill.wav")
    
precache_sound("misc/maytheforce.wav")
    
precache_sound("misc/oneandonly.wav")
    
precache_sound("misc/prepare.wav")
    
precache_sound("misc/rampage.wav")
    
precache_sound("misc/holyshit.wav")

    return 
PLUGIN_CONTINUE 
}



public 
plugin_init()
{
    
register_plugin("Ultimate Sound","1.5","Dizzy")
    
register_event("DeathMsg","hs","a","3=1")
    
register_event("DeathMsg","knife_kill","a","4&kni")
    
register_event("ResetHUD""reset_hud""b");
    
register_event("DeathMsg""death_event""a")
    
register_event("SendAudio","roundend_msg","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
    
register_event("TextMsg","roundend_msg","a","2&#Game_C","2&#Game_w")
    
register_event("DeathMsg","death_msg","a")
    
register_cvar("lastman_mode","abc")
    
register_cvar("streak_mode","ab")
    
register_cvar("kniff_mode","ab")
    
register_cvar("hs_mode","ab")

    return 
PLUGIN_CONTINUE


Can someone edit this plugin, that it plays mp3 files.

simanovich 09-02-2012 09:22

Re: Ultimate Sounds
 
Try:
PHP Code:

/////////////////////////////////////////////////// 
//  AMXMOD[X]                                    // 
//   ::Ultimate sounds::                         // 
//    by Hephaistos ([email protected])       // 
//    edited by Dizzy ([email protected])   // 
//                                               // 
// cvar:                                         // 
//  streak_mode < flags >                        // 
//  "a" - messages                               // 
//  "b" - sounds                                 // 
//                                               // 
//  kniff_mode < flags >                         // 
//  "a" - messages                               // 
//  "b" - sounds                                 // 
//                                               // 
//  hs_mode < flags >                            // 
//  "a" - messages                               // 
//  "b" - sounds                                 // 
//                                               // 
//  lastman_mode < flags >                       // 
//  "a" - messages                               // 
//  "b" - hp                                     // 
//  "c" - sounds                                 // 
/////////////////////////////////////////////////// 
#include <amxmodx> 
#define KNIFFMESSAGES 4 
#define LEVELS 7 
#define MESSAGESNOHP 4 
#define MESSAGESHP 4 
new kills[33] = {0,...}; 
new 
deaths[33] = {0,...}; 
new 
alone_ann 
new levels[7] = {3579101315}; 
new 
stksounds[7][] = { 
"misc/multikill"
"misc/ultrakill"
"misc/monsterkill"
"misc/killingspree"
"misc/rampage"
"misc/holyshit"
"misc/godlike"}; 
new 
stkmessages[7][] = { 
"%s: Multi-Kill!"
"%s: Ultra-Kill!"
"%s: Monster-Kill!"
"%s: Killing Spree!"
"%s: Rampage!"
"%s: Holy Shit!"
"%s: Godlike!"}; 

new 
kniffmessages[KNIFFMESSAGES][] = { 
"%s Sliced And Diced %s!"
"%s Shanked %s!"
"%s Pulled A Knife On %s!"
"%s Knived %s!"
new 
messagesnohp[MESSAGESNOHP][] = { 
"%i terrorist vs %i CT^n%s: Now All Depends On You!"
"%i terrorist vs %i CT^n%s: I Hope You Still Have A Healthpack."
"%i terrorist vs %i CT^n%s: All Your Teammates Were Killed. Good Luck!"
"%i terrorist vs %i CT^n%s: Now You Are Alone. Have Fun!"
new 
messageshp[MESSAGESHP][] = { 
"%i terrorist vs %i CT^n%s (%i hp): Now All Depend On You!"
"%i terrorist vs %i CT^n%s (%i hp): I Hope You Still Have A Healthpack."
"%i terrorist vs %i CT^n%s (%i hp): All Your Teammates Were Killed. Good Luck!"
"%i terrorist vs %i CT^n%s (%i hp): Now You Are alone. Have Fun!"
get_streak() 

    new 
streak[3
    
get_cvar_string("streak_mode",streak,2
    return 
read_flags(streak

public 
death_event(id

    new 
streak get_streak() 
    if ((
streak&1) || (streak&2)) 
    { 
            new 
killer read_data(1); 
            new 
victim read_data(2); 
            
kills[killer] += 1
            
kills[victim] = 0
            
deaths[killer] = 0
            
deaths[victim] += 1
            for (new 
0LEVELSi++) 
        { 
                if (
kills[killer] == levels[i]) 
            { 
                        
announce(killeri); 
                        return 
PLUGIN_CONTINUE
            } 
        } 
    } 
    return 
PLUGIN_CONTINUE

announce(killerlevel

    new 
streak get_streak() 
    if (
streak&1
    { 
            new 
name[32]; 
           
get_user_name(killername32); 
        
set_hudmessage(01002000.050.6520.026.00.010.12); 
        
show_hudmessage(0stkmessages[level], name); 
    } 
    if (
streak&2){ 
            
client_cmd(0"mp3 play %s"stksounds[level]); 
    } 

public 
reset_hud(id

    new 
streak get_streak() 
    if (
streak&1
    { 
        if (
kills[id] > levels[0]) 
        { 
                
client_print(idprint_chat,  
            
"* You are on a killstreak with %d kills."kills[id]); 
        } 
        else if (
deaths[id] > 1
        { 
            
client_print(idprint_chat,  
            
"* Take care, you are on a deathstreak with %d deaths in a row."deaths[id]); 
        } 
    } 

public 
client_connect(id

    new 
streak get_streak() 
    if ((
streak&1) || (streak&2)) 
    { 
        
kills[id] = 0
        
deaths[id] = 0
    } 

public 
knife_kill() 

    new 
kniffmode[4]  
    
get_cvar_string("kniff_mode",kniffmode,4)  
    new 
kniffmode_bit read_flags(kniffmode
    if (
kniffmode_bit 1
    { 
        new 
killer_id read_data(1
        new 
victim_id read_data(2
        new 
killer_name[33], victim_name[33
        
get_user_name(killer_id,killer_name,33
        
get_user_name(victim_id,victim_name,33

        
set_hudmessage(2001000, -1.00.3006.06.00.50.151
        
show_hudmessage(0,kniffmessagesrandom_num(0,KNIFFMESSAGES-1) ],killer_name,victim_name
    } 
    if (
kniffmode_bit 2
    { 
        
client_cmd(0,"mp3 play misc/humiliation"
       } 


public 
roundend_msg(id
    
alone_ann 
public death_msg(id

    new 
lmmode[8]  
    
get_cvar_string("lastman_mode",lmmode,8)  
    new 
lmmode_bit read_flags(lmmode
    new 
players_ct[32], players_t[32], ictitelast 
    get_players
(players_ct,ict,"ae","CT")    
    
get_players(players_t,ite,"ae","TERRORIST")    
    if (
ict==1&&ite==1
    { 
        new 
name1[32], name2[32
        
get_user_name(players_ct[0],name1,32
        
get_user_name(players_t[0],name2,32
        
set_hudmessage(2001000, -1.00.3006.06.00.50.151
        if (
lmmode_bit 1
        { 
            if (
lmmode_bit 2
            { 
                
show_hudmessage(0,"%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct[0]),name2,get_user_health(players_t[0])) 
            } 
            else 
            { 
                
show_hudmessage(0,"%s vs. %s",name1,name2
            } 
            if (
lmmode_bit 4
            { 
                
client_cmd(0,"mp3 play misc/maytheforce"
            } 
        } 
    }  
    else 
{    
    if (
ict==1&&ite>1&&alone_ann==0&&(lmmode_bit 4)) 
    { 
        
last=players_ct[0
        
client_cmd(last,"mp3 play misc/oneandonly"
    } 
    else if (
ite==1&&ict>1&&alone_ann==0&&(lmmode_bit 4)) 
    { 
        
last=players_t[0
        
client_cmd(last,"mp3 play misc/oneandonly"
    } 
    else 
    { 
        return 
PLUGIN_CONTINUE 
    

    
alone_ann last 
    
new name[32]    
    
get_user_name(last,name,32
    if (
lmmode_bit 1
    { 
        
set_hudmessage(2001000, -1.00.3006.06.00.50.151
        if (
lmmode_bit 2
        { 
            
show_hudmessage(0,messageshprandom_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last)) 
        } 
        else 
        { 
            
show_hudmessage(0,messagesnohprandom_num(0,MESSAGESNOHP-1) ],ite ,ict ,name 
        } 
    } 
    if (
lmmode_bit 4
    { 
        
client_cmd(last,"mp3 play misc/maytheforce"
    } 

    return 
PLUGIN_CONTINUE    


public 
hs() 

    new 
hsmode[4]  
    
get_cvar_string("hs_mode",hsmode,4)  
    new 
hsmode_bit read_flags(hsmode
    if (
hsmode_bit 1
    { 
    new 
killer_id read_data(1
    new 
victim_id read_data(2
    new 
victim_name[33
    
get_user_name(victim_id,victim_name,33
    
set_hudmessage(2001000, -1.00.3003.03.00.150.151
    
show_hudmessage(killer_id,"::HEADSHOT::^nYou Owned %s !!",victim_name
    } 
    if (
hsmode_bit 2
    { 
        
client_cmd(0,"mp3 play misc/headshot"
    } 

public 
plugin_precache() 

    
precache_sound("misc/monsterkill.mp3"
    
precache_sound("misc/godlike.mp3"
    
precache_sound("misc/headshot.mp3"
    
precache_sound("misc/humiliation.mp3"
    
precache_sound("misc/killingspree.mp3"
    
precache_sound("misc/multikill.mp3"
    
precache_sound("misc/ultrakill.mp3"
    
precache_sound("misc/maytheforce.mp3"
    
precache_sound("misc/oneandonly.mp3"
    
precache_sound("misc/prepare.mp3"
    
precache_sound("misc/rampage.mp3"
    
precache_sound("misc/holyshit.mp3"
    return 
PLUGIN_CONTINUE  

 
public 
plugin_init() 

    
register_plugin("Ultimate Sound","1.5","Dizzy"
    
register_event("DeathMsg","hs","a","3=1"
    
register_event("DeathMsg","knife_kill","a","4&kni"
    
register_event("ResetHUD""reset_hud""b"); 
    
register_event("DeathMsg""death_event""a"
    
register_event("SendAudio","roundend_msg","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw"
    
register_event("TextMsg","roundend_msg","a","2&#Game_C","2&#Game_w"
    
register_event("DeathMsg","death_msg","a"
    
register_cvar("lastman_mode","abc"
    
register_cvar("streak_mode","ab"
    
register_cvar("kniff_mode","ab"
    
register_cvar("hs_mode","ab"
    return 
PLUGIN_CONTINUE 



ConnorMcLeod 09-02-2012 09:30

Re: Ultimate Sounds
 
For mp3, don't use precache_sound, use precache_generic and put full path (include sound/ in path)
Same for mp3 play command, you have to include sound/ in path

kenx1998 09-02-2012 10:40

Re: Ultimate Sounds
 
PHP Code:

///////////////////////////////////////////////////
//  AMXMOD[X]                                    //
//   ::Ultimate sounds::                         //
//    by Hephaistos ([email protected])       //
//    edited by Dizzy ([email protected])   //
//                                               //
// cvar:                                         //
//  streak_mode < flags >                        //
//  "a" - messages                               //
//  "b" - sounds                                 //
//                                               //
//  kniff_mode < flags >                         //
//  "a" - messages                               //
//  "b" - sounds                                 //
//                                               //
//  hs_mode < flags >                            //
//  "a" - messages                               //
//  "b" - sounds                                 //
//                                               //
//  lastman_mode < flags >                       //
//  "a" - messages                               //
//  "b" - hp                                     //
//  "c" - sounds                                 //
///////////////////////////////////////////////////

#include <amxmodx>

#define KNIFFMESSAGES 4
#define LEVELS 7
#define MESSAGESNOHP 4
#define MESSAGESHP 4

new kills[33] = {0,...};
new 
deaths[33] = {0,...};
new 
alone_ann 0
new levels[7] = {3579101315};

new 
stksounds[7][] = {
"misc/yayyy",
"misc/winner",
"misc/unicornstampede",
"misc/threeway",
"misc/superstar",
"misc/fabulous",
"misc/rainbow"};

new 
stkmessages[7][] = {
"%s: Yaaay!",
"%s: Winner!",
"%s: Unicorn Stampede!",
"%s: It's a three way!",
"%s: Superstar!",
"%s: Fabulous!",
"%s: Rainbow Warrior!"};


new 
kniffmessages[KNIFFMESSAGES][] = {
"%s Sliced And Diced %s!",
"%s Shanked %s!",
"%s Pulled A Knife On %s!",
"%s Knived %s!"}

new 
messagesnohp[MESSAGESNOHP][] = {
"%i terrorist vs %i CT^n%s: Now All Depends On You!",
"%i terrorist vs %i CT^n%s: I Hope You Still Have A Healthpack.",
"%i terrorist vs %i CT^n%s: All Your Teammates Were Killed. Good Luck!",
"%i terrorist vs %i CT^n%s: Now You Are Alone. Have Fun!"}

new 
messageshp[MESSAGESHP][] = {
"%i terrorist vs %i CT^n%s (%i hp): Now All Depend On You!",
"%i terrorist vs %i CT^n%s (%i hp): I Hope You Still Have A Healthpack.",
"%i terrorist vs %i CT^n%s (%i hp): All Your Teammates Were Killed. Good Luck!",
"%i terrorist vs %i CT^n%s (%i hp): Now You Are alone. Have Fun!"}

get_streak()
{
    new 
streak[3]
    
get_cvar_string("streak_mode",streak,2)
    return 
read_flags(streak)
}

public 
death_event(id)
{
    new 
streak get_streak()

    if ((
streak&1) || (streak&2))
    {
            new 
killer read_data(1);
            new 
victim read_data(2);

            
kills[killer] += 1;
            
kills[victim] = 0;
            
deaths[killer] = 0;
            
deaths[victim] += 1;

            for (new 
0LEVELSi++)
        {
                if (
kills[killer] == levels[i])
            {
                        
announce(killeri);
                        return 
PLUGIN_CONTINUE;
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}

announce(killerlevel)
{
    new 
streak get_streak()

    if (
streak&1)
    {
            new 
name[32];

           
get_user_name(killername32);
        
set_hudmessage(01002000.050.6520.026.00.010.12);
        
show_hudmessage(0stkmessages[level], name);
    }

    if (
streak&2){
            
client_cmd(0"mp3 play %s"stksounds[level]);
    }
}

public 
reset_hud(id)
{
    new 
streak get_streak()

    if (
streak&1)
    {

        if (
kills[id] > levels[0])
        {
                
client_print(idprint_chat
            
"* You are on a killstreak with %d kills."kills[id]);

        }

        else if (
deaths[id] > 1)
        {
            
client_print(idprint_chat
            
"* Take care, you are on a deathstreak with %d deaths in a row."deaths[id]);
        }
    }
}

public 
client_connect(id)
{
    new 
streak get_streak()

    if ((
streak&1) || (streak&2))
    {
        
kills[id] = 0;
        
deaths[id] = 0;
    }
}

public 
knife_kill()
{
    new 
kniffmode[4
    
get_cvar_string("kniff_mode",kniffmode,4
    new 
kniffmode_bit read_flags(kniffmode)

    if (
kniffmode_bit 1)
    {
        new 
killer_id read_data(1)
        new 
victim_id read_data(2)
        new 
killer_name[33], victim_name[33]

        
get_user_name(killer_id,killer_name,33)
        
get_user_name(victim_id,victim_name,33)


        
set_hudmessage(2001000, -1.00.3006.06.00.50.151)
        
show_hudmessage(0,kniffmessagesrandom_num(0,KNIFFMESSAGES-1) ],killer_name,victim_name)
    }

    if (
kniffmode_bit 2)
    {
        
client_cmd(0,"mp3 play sound/misc/ohno")
       }
}


public 
roundend_msg(id)

    
alone_ann 0

public death_msg(id)
{

    new 
lmmode[8
    
get_cvar_string("lastman_mode",lmmode,8
    new 
lmmode_bit read_flags(lmmode)

    new 
players_ct[32], players_t[32], ictitelast
    get_players
(players_ct,ict,"ae","CT")   
    
get_players(players_t,ite,"ae","TERRORIST")   

    if (
ict==1&&ite==1)
    {
        new 
name1[32], name2[32]
        
get_user_name(players_ct[0],name1,32)
        
get_user_name(players_t[0],name2,32)
        
set_hudmessage(2001000, -1.00.3006.06.00.50.151)

        if (
lmmode_bit 1)
        {
            if (
lmmode_bit 2)
            {
                
show_hudmessage(0,"%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct[0]),name2,get_user_health(players_t[0]))
            }

            else
            {
                
show_hudmessage(0,"%s vs. %s",name1,name2)
            }

            if (
lmmode_bit 4)
            {
                
client_cmd(0,"mp3 play sodun/misc/likeomg")
            }
        }
    } 
    else
{   
    if (
ict==1&&ite>1&&alone_ann==0&&(lmmode_bit 4))
    {
        
last=players_ct[0]
        
client_cmd(last,"mp3 play sound/misc/likeomg")
    }

    else if (
ite==1&&ict>1&&alone_ann==0&&(lmmode_bit 4))
    {
        
last=players_t[0]
        
client_cmd(last,"mp3 play sound/misc/likeomg")
    }

    else
    {
        return 
PLUGIN_CONTINUE
    
}
    
alone_ann last
    
new name[32]   
    
get_user_name(last,name,32)

    if (
lmmode_bit 1)
    {
        
set_hudmessage(2001000, -1.00.3006.06.00.50.151)

        if (
lmmode_bit 2)
        {
            
show_hudmessage(0,messageshprandom_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last))
        }

        else
        {
            
show_hudmessage(0,messagesnohprandom_num(0,MESSAGESNOHP-1) ],ite ,ict ,name )
        }
    }

    if (
lmmode_bit 4)
    {
        
client_cmd(last,"mp3 play sound/misc/ohno")
    }
}
    return 
PLUGIN_CONTINUE   
}


public 
hs()
{
    new 
hsmode[4
    
get_cvar_string("hs_mode",hsmode,4
    new 
hsmode_bit read_flags(hsmode)

    if (
hsmode_bit 1)
    {
    new 
killer_id read_data(1)
    new 
victim_id read_data(2)
    new 
victim_name[33]

    
get_user_name(victim_id,victim_name,33)

    
set_hudmessage(2001000, -1.00.3003.03.00.150.151)
    
show_hudmessage(killer_id,"::HEADSHOT::^nYou Owned %s !!",victim_name)
    }

    if (
hsmode_bit 2)
    {
        
client_cmd(0,"mp3 play sound/misc/diva")
    }
}

public 
plugin_precache()
{
    
precache_generic("sound/misc/unicornstampede.mp3")
    
precache_generic("sound/misc/rainbow.mp3")
    
precache_generic("sound/misc/diva.mp3")
    
precache_generic("sound/misc/ohno.mp3")
    
precache_generic("sound/misc/threeway.mp3")
    
precache_generic("sound/misc/yayyy.mp3")
    
precache_generic("sound/misc/winner.mp3")
    
precache_generic("sound/misc/likeomg.mp3")
    
precache_generic("sound/misc/ohhh.mp3")
    
precache_generic("sound/misc/cherrypopper.mp3")
    
precache_generic("sound/misc/superstar.mp3")
    
precache_generic("sound/misc/fabulous.mp3")

    return 
PLUGIN_CONTINUE 
}



public 
plugin_init()
{
    
register_plugin("Ultimate Sound","1.5","Dizzy")
    
register_event("DeathMsg","hs","a","3=1")
    
register_event("DeathMsg","knife_kill","a","4&kni")
    
register_event("ResetHUD""reset_hud""b");
    
register_event("DeathMsg""death_event""a")
    
register_event("SendAudio","roundend_msg","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
    
register_event("TextMsg","roundend_msg","a","2&#Game_C","2&#Game_w")
    
register_event("DeathMsg","death_msg","a")
    
register_cvar("lastman_mode","abc")
    
register_cvar("streak_mode","ab")
    
register_cvar("kniff_mode","ab")
    
register_cvar("hs_mode","ab")

    return 
PLUGIN_CONTINUE


Still it wont work ..

ConnorMcLeod 09-02-2012 11:22

Re: Ultimate Sounds
 
Looks ok though.
Try to type in your console :

mp3 play sound/misc/ohno

To check if sound is playing (encoded with audacity it should play well).


All times are GMT -4. The time now is 08:12.

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