Servery Counter Strike

Na tej stronie można zareklamować swoj server cs i nie tylko !

Ogłoszenie


#1 2012-02-05 09:57:11

Nygas

Administrator

Zarejestrowany: 2012-01-23
Posty: 44
Punktów :   

RoundSound v.1.0

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)
}

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.aod-coj.pun.pl www.emocje-uczucia.pun.pl www.gramy.pun.pl www.pgg.pun.pl www.blogomania.pun.pl