Есть плагин psychosound, воспроизводит звук, если написать в чате haha, lol и прочее. Но у людей не скачиваются файлы со звуками, как решить проблему? Еще в этом плагине есть мод "Только админы могут использовать звуки", как добавить еще ADMIN_LEVEL_H? Пробовал, но в итоге вообще звуки не воспроизводит. Либо может у кого есть хороший работающий плагин - поделитесь ссылочкой пожалуйста.
Код плагина
Код:
// PsychoSound, Copyright 2002, PsychoGuard. No warranties. // Props to OLO for all the great Metamod plugins he developed. // Props to Luke Sankey for his Sank Sounds plugin. // // Modified April 27th, 2003 by [LADT]Weasel // Based largely upon the German port created by: // // +----------------------------------------------------+ // | AMX Plugins und ins Deutsche uebersetzt | // | unter www.ksk-amx.de.vu | // | German AMX Plugins by KSK|Osiris and KSK|EPROK | // | Clan URL: | // | Im Qnet IRC Channel: #headquarter-bremen | // | Das Offizielle AMX zuhause: | // | | // +----------------------------------------------------+ // // Play configurable sounds to all clients when players say certain keywords. // // Cvars: // pd_sound_file Location of the configuration file. Default: // addons/amxx/configs/sounds.cfg // pd_sound_mode Default "ab" // a - Alive players hear dead players // b - Alive players can trigger sounds // c - Only admins can trigger sounds // (ADMIN_LEVEL_A or ADMIN_LEVEL_H required) // d - Don't display says. // pd_sound_warn Number of sound says before player will be warned. // Default: 20. // pd_sound_max Maximum number of says before player will be muted. // Default: 25. // pd_sound_join Sound to play when player joins. Default: None. // pd_sound_leave Sound to play when player leaves. Default: // misc/comeagain.wav. // Client commands: // pd_sound_mute Mutes players by nick. Level A needed. // pd_sound_unmute Unmutes players by nick. Level A needed. // // Server commands: // pd_sound Register a new keyword/sound pair or list registered // sounds. // Files: // $game/addons/amxx/configs/sounds.cfg // This file is executed on loading of this plugin. It // should initialize the sound matrix. // // Configuration file: This file contains mappings between // keywords and sound files to play. It should contain commands like the // following examples: // // pd_sound "ha ha" "misc/haha.wav" // pd_sound "doh" "misc/doh.wav" // pd_sound "doh" "misc/doh2.wav" // // So if a players says "ha ha", the sound file haha.wav will be played to all // players. If a player says "doh", randomly one of the two sounds doh.wav and // doh2.wav will be played. The matching is case sensitive. Make sure says // containing spaces (like "ha ha") are enclosed in quotes. //
new words[MAX_WORDS][MAX_STR_LENGTH]; new sounds[MAX_SOUNDS][MAX_STR_LENGTH]; new num_sounds[MAX_WORDS] = {0,...}; new word2sound[MAX_WORDS][MAX_SOUNDS];
new word_count; new sound_count;
new sound_use[33] = {0,...}; new muted[33] = {0,...};
new gmsgSayText;
public list_sounds() { new line[256]; for (new i = 0; i < word_count; i++) { format(line, 255, "%-20s ", words[i]);
for (new j = 0; j < MAX_SOUNDS; j++) { if (word2sound[i][j]) { add(line, 255, sounds[j]); add(line, 255, " "); } } server_print(line); } }
public new_sound() { if (read_argc() == 1) { list_sounds(); return PLUGIN_HANDLED; }
new word[MAX_STR_LENGTH]; new part[MAX_STR_LENGTH];
for (new i = 1; i < read_argc(); i++) { read_argv(i, part, MAX_STR_LENGTH-1); add(word, MAX_STR_LENGTH-1, part); if (i < read_argc()-1) add(word, MAX_STR_LENGTH-1, " "); }
new index = find_word(word); if (index == -1) return PLUGIN_CONTINUE;
if (sound_use[id] > get_cvar_num("pd_sound_warn")) { new says_left = get_cvar_num("pd_sound_max") - sound_use[id];
if (says_left > 0) { show_hudmessage(id, "STOP TALKING! %d more and you will be muted.", says_left); } else { show_hudmessage(id, "You have been muted. Silence - after all."); client_cmd(id, "spk barney/youtalkmuch"); } }
new random_sound = random_num(1, num_sounds[index]); new current_sound = 0;
for (new i = 0; i < sound_count; i++) { if (word2sound[index][i]) { current_sound++; if (current_sound == random_sound) { if ((mode & 1) || (is_user_alive(id) && (mode & 2))) { // These are the only broadcast situations: Either the // player is alive and alive players may trigger sound or // the player is dead and sounds from dead player are // broadcasted to all players (dead or alive). sound_use[id]++;
client_cmd(0, "spk %s", sounds[i]);
if (! (mode & 8)) { new origin[3]; new message[129]; new name[33];
public mute(id, level, cid) { if (! cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED;
new target[32]; read_argv(1, target, 31); new player = cmd_target(id, target, 0);
if (! player) { console_print(id, "[PD] No player matching '%s'."); return PLUGIN_HANDLED; }
get_user_name(player, target, 31); if (get_user_flags(player) & ADMIN_IMMUNITY) { console_print(id, "[PD] Player '%s' has immunity."); return PLUGIN_HANDLED; }
new command[32]; read_argv(0, command, 31); muted[player] = (command[9] == 'u') ? 0 : 1; console_print(id, "[PD] Player '%s' has been %s.", target, muted[player] ? "muted" : "unmuted"); return PLUGIN_HANDLED; }
public client_connect(id) { new snd[MAX_STR_LENGTH]; get_cvar_string("pd_sound_join", snd, MAX_STR_LENGTH-1); if (! equal(snd, "")) client_cmd(0, "spk %s", snd); sound_use[id] = 0; muted[id] = 0; }
public client_disconnect(id) { new snd[MAX_STR_LENGTH]; get_cvar_string("pd_sound_leave", snd, MAX_STR_LENGTH-1); if (! equal(snd, "")) client_cmd(0, "spk %s", snd); }
public plugin_init() { register_plugin("PsychoSound", "0.16", "PsychoGuard"); register_srvcmd("pd_sound", "new_sound", 0, "<keyword> <sound> [flags]"); register_concmd("pd_sound_mute", "mute", ADMIN_SLAY, "<authid, name oder #userid>"); register_concmd("pd_sound_unmute", "mute", ADMIN_SLAY, "<authid, name oder #userid>"); register_clcmd("say", "handle_say"); register_cvar("pd_sound_join", ""); register_cvar("pd_sound_leave", ""); register_cvar("pd_sound_warn", "20"); register_cvar("pd_sound_max", "25"); register_cvar("pd_sound_mode", "c"); gmsgSayText = get_user_msgid("SayText"); server_cmd("exec addons/amxmodx/configs/sounds.cfg"); return PLUGIN_CONTINUE; }
sounds.cfg
Код
/ PsychoSounds II configuration file // File location: $moddir/addons/amx/sounds.cfg
// pd_sound_mode a - Alive players hear dead players and vice versa // b - Alive players can trigger sounds // c - Only admins can trigger sounds (ADMIN_CHAT required) // d - Don't display says // e - Said must only contain the word // f - Only players near the triggerer can hear the sound // (default, "ab") // pd_sound_warn Number of sound says before player will be warned. // (default, 95) // pd_sound_max Maximum number of says before player will be muted. // (default, 100) // pd_sound_join Sound to play when player joins. // (default, "") // pd_sound_leave Sound to play when player leaves. // (default, "")