i want to daley custom sound from vens plugin hostage voices:
Code:
public forward_emit_sound(ent, channel, const sample[], Float:volume, Float:attenuation, flags, pitch) {
static mode
mode = get_pcvar_num(g_pcvar_mode)
// if plugin is disabled or entity isn't valid do not go further
if (!mode || !pev_valid(ent))
return FMRES_IGNORED
static bool:is_headshot
is_headshot = false
// if it's a headshot sound
if (equali(sample, g_headshot_sound_prefix, sizeof g_headshot_sound_prefix - 1)) {
is_headshot = true
// if custom voice on headshot feature is disbaled do not go further
if (mode < 2)
return FMRES_IGNORED
}
// if "disable hostage voices" mode is enabled
if (mode < 0) {
if (is_headshot)
return FMRES_IGNORED
static classname[32]
pev(ent, pev_classname, classname, sizeof classname - 1)
static hostage_entity[] = "hostage_entity"
// if it's a hostage
if (equal(classname, hostage_entity))
// disable hostage voice
return FMRES_SUPERCEDE
}
static i
// if it isn't one of the custom hostages do not go further
if ((i = get_hostageent_arrayelem_index(ent)) == -1)
return FMRES_IGNORED
static loaded_phrases_num
// if no loaded phrases for this hostage do not go further
if ((loaded_phrases_num = g_loaded_phrases_num[i]) == 0)
return FMRES_IGNORED
static j
// retrieve a random phrase index
j = random(loaded_phrases_num)
static phrase_start_char
phrase_start_char = g_hostages_phrases[i][j][0]
// if empty phrase
if (phrase_start_char == '^0')
// disable hostage voice
return FMRES_SUPERCEDE
else if (phrase_start_char == '*')
// allow original hostage voice
return FMRES_IGNORED
new params[7]
params[0]=channel
params[1]=g_hostages_phrases[i][j]
params[2]=volume
params[3]=attenuation
params[4]=flags
params[5]=pitch
params[6]=ent
set_task(0.1, "gadaj", 6666+ent, params, 6)
// supercede original voice
return FMRES_SUPERCEDE
}
public gadaj(params[])
{
// emit our custom voice
engfunc(EngFunc_EmitSound, params[6], params[0], params[1], params[2], params[3], params[4], params[5])
}
params[1]=g_hostages_phrases[i][j]
gives me Error: Must be assigned to an array on line 185
how to correct it ?
__________________