Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
//Un-conment for FirstDamaSound to work
//new bool:DamageDone
new bool:FirstDeathDone
// Un-conment for FirstDamageSound to work (need your own sound file)
//new const FirstDamageSound[] = "sounds/YourSoundFile.mp3"
new const KnifeDeathSound[] = "sounds/idiotsong.mp3"
new const AdminDieSound[] = "sounds/wtf.mp3"
new const FreezeTimeEndSound[] = "sounds/nam1.mp3"
new const DisconnectSound[] = "sounds/thanks.mp3"
new const FirstDeathSound[] = "sounds/kenny1.mp3"
new const AdminDieSound3[] = "sounds/pray.mp3"
new const AdminDieSound5[] = "sounds/bendover.mp3"
new const Kill3Sound[] = "sounds/kickass1.mp3"
public plugin_precache() {
// Un-conment for FirstDamageSound
//precache_generic(szFirstDamageSound[])
precache_generic(KnifeDeathSound)
precache_generic(AdminDieSound)
precache_generic(FreezeTimeEndSound)
precache_generic(DisconnectSound)
precache_generic(FirstDeathSound)
precache_generic(AdminDieSound3)
precache_generic(AdminDieSound5)
precache_generic(Kill3Sound)
}
public plugin_init() {
register_plugin("Sounds", "1.0", "Rolnaaba")
register_event("HLTV", "newround", "a", "1=0", "2=0")
// Un-conment for FirstDamageSound
//register_event("Damage", "FirstDamage", "a")
register_event("DeathMsg", "Death", "a", "1>0")
register_logevent("logevent_round_start", 2, "1=Round_Start")
}
public newround(id) { //sets variables that control first_damage, and first_death sounds to false
// Un-conment for FirstDamageSound
//DamageDone = false
FirstDeathDone = false
}
// Un-conment for FirstDamageSound:
//public FirstDamage(id) { //is called whenever dmaage is dealt
// if (DamageDone == false) {//checks if damage has been done already
// client_cmd(0, "mp3 play %s", FirstDamageSound) //plays first damage sound
// DamageDone = true //makes sure this only happens on first damage (per round)
// }
//}
public Death() { //is called upon death of anyone
new WeaponName[20]
new WeaponID = get_weaponid(WeaponName)
new killer = read_data(1)
new victim = read_data(2)
read_data(4, WeaponName, 19)
if(WeaponID == CSW_KNIFE) { //checks if Death was result of knife
client_cmd(0, "mp3 play %s", KnifeDeathSound) //plays knife death sound
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "Someone has died by the KNIFE!!")
}
else if(FirstDeathDone == false) { //if death wasnt result of knife, and is first death continues
client_cmd(0, "mp3 play %s", FirstDeathSound) //plays First death sound
FirstDeathDone = true //makes sure only plays first death sound once per round
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "The first death has taken place!")
}
else if(access(victim, ADMIN_LEVEL_B) && get_user_deaths(victim) == 1) { //checks access level of the victim
client_cmd(0, "mp3 play %s", AdminDieSound) //plays Admin death sound
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "The Admin has Died!!"
}
else if(access(victim, ADMIN_LEVEL_B) && get_user_deaths(victim) == 3) {
client_cmd(0, "mp3 play %s", AdminDieSound3)
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "The Admin has Died for the Third TIME!!"
}
else if(access(victim, ADMIN_LEVEL_B) && get_user_deaths(victim) == 5) {
client_cmd(0, "mp3 play %s", AdminDieSound5)
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(0, "The Admin has died for the Fifth TIME!!")
}
else if(get_user_frags(killer) == 3) {
client_cmd(0, "mp3 play %s", Kill3Sound)
}
}
public logevent_round_start() { //is called at end of freeze time
client_cmd(0, "mp3 play %s", FreezeTimeEndSound) //plays freeze time end sound
}
public client_disconnect(id) { //is called when someone disconnects
client_cmd(0, "mp3 play %s", DisconnectSound) //plays disconnect sound
}
Error is on precache_generic lines (all of them) it is not coments, absence of the arrays or anything I can find so why am I getting this error?