| MouseSplash! |
01-31-2010 02:29 |
Help [Sounds for take and kill]
PHP Code:
public FwdTakeDamage(victim, inflictor, attacker, Float:damage, damage_bits) { switch(get_user_team(attacker)) { case 1: { SoundsTake[victim] = 1 } case 2: { SoundsTake[victim] = 1 } } return HAM_HANDLED }
public fw_Killed(victim, attacker, shouldgib) { if(get_user_team(attacker) == 1) { SoundsKill[victim] = 1 } return HAM_HANDLED }
public Fwd_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch) { if(SoundsKill[id]) { switch (random_num(1, 2)) { case 1: engfunc(EngFunc_EmitSound, id, channel, deadct1, volume, attn, flags, pitch) case 2: engfunc(EngFunc_EmitSound, id, channel, deadct2, volume, attn, flags, pitch) } } if(SoundsTake[id]) { switch(get_user_team(id)) { case 1: { switch (random_num(1, 3)) { case 1: engfunc(EngFunc_EmitSound, id, channel, taket1, volume, attn, flags, pitch) case 2: engfunc(EngFunc_EmitSound, id, channel, taket2, volume, attn, flags, pitch) case 3: engfunc(EngFunc_EmitSound, id, channel, taket3, volume, attn, flags, pitch) } } case 2: { switch (random_num(1, 3)) { case 1: engfunc(EngFunc_EmitSound, id, channel, takect1, volume, attn, flags, pitch) case 2: engfunc(EngFunc_EmitSound, id, channel, takect2, volume, attn, flags, pitch) case 3: engfunc(EngFunc_EmitSound, id, channel, takect3, volume, attn, flags, pitch) } } } } return FMRES_IGNORED; }
|