REKLAM ALANI

Pawn (CS:1.6 ReAPI) - Switch Kullanımı (Elsonu eklentisi üzerinde)

Pawn (CS:1.6 ReAPI) - Switch Kullanımı (Elsonu eklentisi üzerinde)

avatar enesizm
Forum Üyesi
4666
#1
Yorumu Paylaş

Kod:
#include <amxmodx>
#include <reapi>

#define el_sonu1 "test1.wav"
#define el_sonu2 "test2.wav"
#define el_sonu3 "test3.wav"
#define el_sonu4 "test4.wav"

public plugin_init()
{
    register_plugin("test eklenti", "1.0", "enesizm");
    RegisterHookChain(RG_RoundEnd, "elsonu", 1);
}
public plugin_precache()
precache_sound(el_sonu1),
precache_sound(el_sonu2),
precache_sound(el_sonu3),
precache_sound(el_sonu4);

public elsonuswitch()
    client_cmd(0, "stopsound"),
    set_task(0.1, "switchkullanim");

public switchkullanim()
{
    switch(random_num(1,4)) {   // oluşturduğumuz case'ler ile her el sonunda 4 şarkıdan 1 tanesini çalmasını istiyoruz eklentiden.
        case 1: rg_send_audio(0, el_sonu1); // rg_send_audio kodu yerine farklı kodlar kullanabilirsiniz.
        case 2: rg_send_audio(0, el_sonu2);
        case 3: rg_send_audio(0, el_sonu3);
        case 4: rg_send_audio(0, el_sonu4);
    }
}
deneme
Forum Üyesi

Konuda Ara

0 Yorum


Konuyu Okuyanlar: