Nygas - 2012-02-05 09:57:11

Chyba najbardziej uniwersalny RoundSound spośród dostępnych w sieci bez jakiegoś skompilowanego kodu .



Kod:

#include <amxmodx>

new const sounds_tt[][] =
{
    "misc/roundsound/tt1.mp3",
    "misc/roundsound/tt2.mp3",
    "misc/roundsound/tt3.mp3",
    "misc/roundsound/tt4.mp3",
    "misc/roundsound/tt5.mp3"
}

new const sounds_ct[][] =
{
    "misc/roundsound/ct1.mp3",
    "misc/roundsound/ct2.mp3",
    "misc/roundsound/ct3.mp3",
    "misc/roundsound/ct4.mp3",
    "misc/roundsound/ct5.mp3",
    "misc/roundsound/ct6.mp3"
}

public plugin_precache() 
{
    for (new i = 0; i < sizeof sounds_tt; i++)
       precache_sound(sounds_tt[i])
       
    for (new i = 0; i < sizeof sounds_ct; i++)
       precache_sound(sounds_ct[i])
}

public plugin_init() 
{ 
    register_plugin("RoundSound","1.0","KaMaZZ")
    register_event("SendAudio", "tt_win", "a", "2&%!MRAD_terwin")
    register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
}

public tt_win()
{
    client_cmd(0,"stopsound")
    play_sound(0, sounds_tt[random_num(0, sizeof sounds_tt - 1)])
    
    return PLUGIN_CONTINUE
}

public ct_win()
{
    client_cmd(0,"stopsound")
    play_sound(0, sounds_ct[random_num(0, sizeof sounds_ct - 1)])

    return PLUGIN_CONTINUE
}  

stock play_sound(index, const dzwiek[])
{
    if(contain(dzwiek, ".mp3") != -1)
    {
        new soundform[64]
        format(soundform, 63, "sound/%s", dzwiek)
        client_cmd(index, "mp3 play %s", soundform)
    }
    else
       client_cmd(index, "spk %s", dzwiek)
}
www.cshajtownia.pun.pl www.shahrukh-juhi.pun.pl www.konriom.pun.pl www.metinamia.pun.pl www.forumdlainteligentnych.pun.pl