if i can get it going properly...
Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <amxmisc>
#include <fun>
public plugin_init()
{
register_plugin("Star Wars","0.1","Front Line")
register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")
register_clcmd("array_go","check_uncheck")
register_forward( FM_EmitSound, "EmitSound" )
}
public plugin_precache()
{
precache_sound("sound/misc/DVTheme.wav")
precache_sound("sound/misc/JediTheme.wav")
precache_sound("sound/weapons/saber_ignite.wav")
precache_sound("sound/weapons/saber_hit1.wav")
precache_sound("sound/weapons/saber_hit2.wav")
precache_sound("sound/weapons/saber_hit3.wav")
precache_sound("sound/weapons/saber_hit4.wav")
precache_sound("sound/weapons/saber_hitwall1.wav")
precache_sound("sound/weapons/saber_slash1.wav")
precache_sound("sound/weapons/saber_slash2.wav")
precache_sound("sound/weapons/saber_stab.wav")
}
public t_win()
{
client_cmd(0, "spk misc/DVTheme")
return PLUGIN_HANDLED
}
public ct_win()
{
client_cmd(0, "spk misc/JediTheme")
return PLUGIN_HANDLED
}
new array_go[33]
public check_uncheck(id)
{
if ( array_go[id] !=0 )
{
array_go[id] = 0
return PLUGIN_HANDLED
}
else
{
array_go[id] = 1
}
return PLUGIN_HANDLED
}
public EmitSound(entity, channel, const sound[])
{
if( entity > 32 || entity < 1 )
return FMRES_IGNORED;
if( array_go[entity] !=0 )
{
if( containi( sound, "sound/weapons/knife_deploy1.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_ignite.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_hit1.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_hit2.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_hit3.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_hit3.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_hit4.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_hit4.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_hitwall1.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_hitwall1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_slash1.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_slash1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_slash2.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_slash2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
if( containi( sound, "sound/weapons/knife_stab.wav" ) != -1 )
{
emit_sound( entity, channel, "sound/weapons/saber_stab.wavv", 1.0, ATTN_NORM, 0, PITCH_NORM );
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}