// Custom sounds new Array:g_sound_zombie_pain new Array:g_sound_nemesis_pain new Array:g_sound_assassin_pain new Array:g_sound_zombie_die new Array:g_sound_zombie_fall new Array:g_sound_zombie_miss_slash new Array:g_sound_zombie_miss_wall new Array:g_sound_zombie_hit_normal new Array:g_sound_zombie_hit_stab new Array:g_sound_zombie_idle new Array:g_sound_zombie_idle_last
// If we couldn't load custom sounds from file, use and save default ones new index if (ArraySize(g_sound_zombie_pain) == 0) { for (index = 0; index < sizeof sound_zombie_pain; index++) ArrayPushString(g_sound_zombie_pain, sound_zombie_pain[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE PAIN", g_sound_zombie_pain) } if (ArraySize(g_sound_nemesis_pain) == 0) { for (index = 0; index < sizeof sound_nemesis_pain; index++) ArrayPushString(g_sound_nemesis_pain, sound_nemesis_pain[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "NEMESIS PAIN", g_sound_nemesis_pain) } if (ArraySize(g_sound_assassin_pain) == 0) { for (index = 0; index < sizeof sound_assassin_pain; index++) ArrayPushString(g_sound_assassin_pain, sound_assassin_pain[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ASSASSIN PAIN", g_sound_assassin_pain) } if (ArraySize(g_sound_zombie_die) == 0) { for (index = 0; index < sizeof sound_zombie_die; index++) ArrayPushString(g_sound_zombie_die, sound_zombie_die[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE DIE", g_sound_zombie_die) } if (ArraySize(g_sound_zombie_fall) == 0) { for (index = 0; index < sizeof sound_zombie_fall; index++) ArrayPushString(g_sound_zombie_fall, sound_zombie_fall[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE FALL", g_sound_zombie_fall) } if (ArraySize(g_sound_zombie_miss_slash) == 0) { for (index = 0; index < sizeof sound_zombie_miss_slash; index++) ArrayPushString(g_sound_zombie_miss_slash, sound_zombie_miss_slash[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE MISS SLASH", g_sound_zombie_miss_slash) } if (ArraySize(g_sound_zombie_miss_wall) == 0) { for (index = 0; index < sizeof sound_zombie_miss_wall; index++) ArrayPushString(g_sound_zombie_miss_wall, sound_zombie_miss_wall[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE MISS WALL", g_sound_zombie_miss_wall) } if (ArraySize(g_sound_zombie_hit_normal) == 0) { for (index = 0; index < sizeof sound_zombie_hit_normal; index++) ArrayPushString(g_sound_zombie_hit_normal, sound_zombie_hit_normal[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE HIT NORMAL", g_sound_zombie_hit_normal) } if (ArraySize(g_sound_zombie_hit_stab) == 0) { for (index = 0; index < sizeof sound_zombie_hit_stab; index++) ArrayPushString(g_sound_zombie_hit_stab, sound_zombie_hit_stab[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE HIT STAB", g_sound_zombie_hit_stab) } if (ArraySize(g_sound_zombie_idle) == 0) { for (index = 0; index < sizeof sound_zombie_idle; index++) ArrayPushString(g_sound_zombie_idle, sound_zombie_idle[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE IDLE", g_sound_zombie_idle) } if (ArraySize(g_sound_zombie_idle_last) == 0) { for (index = 0; index < sizeof sound_zombie_idle_last; index++) ArrayPushString(g_sound_zombie_idle_last, sound_zombie_idle_last[index])
// Save to external file amx_save_setting_string_arr(ZP_SETTINGS_FILE, "Sounds", "ZOMBIE IDLE LAST", g_sound_zombie_idle_last) }
// Precache sounds new sound[SOUND_MAX_LENGTH] for (index = 0; index < ArraySize(g_sound_zombie_pain); index++) { ArrayGetString(g_sound_zombie_pain, index, sound, charsmax(sound)) precache_sound(sound) } // Nemesis Class loaded? if (LibraryExists(LIBRARY_NEMESIS, LibType_Library)) { for (index = 0; index < ArraySize(g_sound_nemesis_pain); index++) { ArrayGetString(g_sound_nemesis_pain, index, sound, charsmax(sound)) precache_sound(sound) } } // Assassin Class loaded? else if (LibraryExists(LIBRARY_ASSASSIN, LibType_Library)) { for (index = 0; index < ArraySize(g_sound_assassin_pain); index++) { ArrayGetString(g_sound_assassin_pain, index, sound, charsmax(sound)) precache_sound(sound) } } for (index = 0; index < ArraySize(g_sound_zombie_die); index++) { ArrayGetString(g_sound_zombie_die, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_fall); index++) { ArrayGetString(g_sound_zombie_fall, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_miss_slash); index++) { ArrayGetString(g_sound_zombie_miss_slash, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_miss_wall); index++) { ArrayGetString(g_sound_zombie_miss_wall, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_hit_normal); index++) { ArrayGetString(g_sound_zombie_hit_normal, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_hit_stab); index++) { ArrayGetString(g_sound_zombie_hit_stab, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_idle); index++) { ArrayGetString(g_sound_zombie_idle, index, sound, charsmax(sound)) precache_sound(sound) } for (index = 0; index < ArraySize(g_sound_zombie_idle_last); index++) { ArrayGetString(g_sound_zombie_idle_last, index, sound, charsmax(sound)) precache_sound(sound) } }
public plugin_natives() { set_module_filter("module_filter") set_native_filter("native_filter") } public module_filter(const module[]) { if (equal(module, LIBRARY_NEMESIS)) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; } public native_filter(const name[], index, trap) { if (!trap) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; }
// Emit Sound Forward public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch) { // Replace these next sounds for zombies only if (!is_user_connected(id) || !zp_core_is_zombie(id)) return FMRES_IGNORED;
I am adding this all to my knifeitup . iam very much impressed with ur cs_core include. i request to add more features very cool so i want to know i want to use both wav + mp3 so how to precache them and use them from config