Tessék, itt a kész kód: a //-el kezdődő sort nem veszi figyelembe ( nálam nem, de a biztonság kedvéért töröld ki, ha megértetted! )
#include <amxmodx> #include <amxmisc>
#define PLUGIN "Headshot Sounds" #define VERSION "1.0" #define AUTHOR "KeXxX"
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("DeathMsg", "DeathMsg", "a") }
public DeathMsg() { new hs = read_data(3) if (hs > 0){ new los = random_num(0, 9) //ha 15-öt akarsz, akkor: (0,14), mivel a 0 is egynek számít switch(los){ case 0 : client_cmd(0, "spk headshot_sounds/headshot1.wav") case 1 : client_cmd(0, "spk headshot_sounds/headshot2.wav") case 2 : client_cmd(0, "spk headshot_sounds/headshot3.wav") case 3 : client_cmd(0, "spk headshot_sounds/headshot4.wav") case 4 : client_cmd(0, "spk headshot_sounds/headshot5.wav") //a többi hang, fontos, hogy a case,t folyasd, és figyelj a hang helyére, nevére case 5 : client_cmd(0, "spk headshot_sounds/headshot6.wav") case 6 : client_cmd(0, "spk headshot_sounds/headshot7.wav") case 7 : client_cmd(0, "spk headshot_sounds/headshot8.wav") case 8 : client_cmd(0, "spk headshot_sounds/headshot9.wav") case 9 : client_cmd(0, "spk headshot_sounds/headshot10.wav") } }else{ return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } public plugin_precache(){ precache_sound("headshot_sounds/headshot1.wav") precache_sound("headshot_sounds/headshot2.wav") precache_sound("headshot_sounds/headshot3.wav") precache_sound("headshot_sounds/headshot4.wav") precache_sound("headshot_sounds/headshot5.wav") //letöltés, itt csak a hang helyére, nevére figyelj precache_sound("headshot_sounds/headshot6.wav") precache_sound("headshot_sounds/headshot7.wav") precache_sound("headshot_sounds/headshot8.wav") precache_sound("headshot_sounds/headshot9.wav") precache_sound("headshot_sounds/headshot10.wav") } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par } */
|