|
Member
|

07-29-2014
, 01:22
Emit_sound error
|
#1
|
I'd like to replace player noise if they use character Female, Here's my code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #include <fakemeta>
#define PLUGIN "Sound replace" #define VERSION "Testing" #define AUTHOR "Gian_Yagami" #define channel #define fw_EmitSound
new const SOUND_F_BHIT[3][] = { "player/f_bhit_flesh-1.wav", "player/f_bhit_flesh-2.wav", "player/f_bhit_flesh-3.wav"} new const SOUND_F_DIE[3][] = { "player/f_die1.wav", "player/f_die2.wav", "player/f_die3.wav"} new const SOUND_F_HS[3][] = { "player/f_headshot1.wav", "player/f_headshot2.wav", "player/f_headshot3.wav"}
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_EmitSound, "fw_EmitSound") }
public plugin_precache() { for (new i = 0; i <= 2; i++) { engfunc(EngFunc_PrecacheSound, SOUND_F_BHIT[i]) engfunc(EngFunc_PrecacheSound, SOUND_F_DIE[i]) engfunc(EngFunc_PrecacheSound, SOUND_F_HS[i]) }
new model[32]
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch) { if (!is_user_connected(id)){ return FMRS_IGNORED; } get_user_info(id, model, 31) if(equal(model, "yuri") new sound[101] for (new i = 0; i <= 2; i++) { // Hit format(sound, charsmax(sound), "%s", SOUND_F_BHIT[i]) replace(sound, charsmax(sound), "player/f_", "player/") if (equal(sample, sound)) { emit_sound(id, channel, SOUND_F_BHIT[i], volume, attn, flags, pitch) return FMRES_SUPERCEDE; } // Die format(sound, charsmax(sound), "%s", SOUND_F_DIE[i]) replace(sound, charsmax(sound), "player/f_", "player/") if (equal(sample, sound)) { emit_sound(id, channel, SOUND_F_DIE[i], volume, attn, flags, pitch) return FMRES_SUPERCEDE; } // Headshot format(sound, charsmax(sound), "%s", SOUND_F_HS[i]) replace(sound, charsmax(sound), "player/f_", "player/") if (equal(sample, sound)) { emit_sound(id, channel, SOUND_F_HS[i], volume, attn, flags, pitch) return FMRES_SUPERCEDE; } } //client_print(id, print_chat, "[%s]", sample) return FMRES_IGNORED; }
compile error message:
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Warning: Loose indentation on line 41
Error: Invalid expression, assumed zero on line 43
Error: Undefined symbol "id" on line 43
Error: Invalid expression, assumed zero on line 43
Error: Too many error messages on one line on line 43
Compilation aborted.
4 Errors.
Could not locate output file C:\Users\Compaq\Desktop\woman_sounds.amx (compile failed).
|
|
|