When a player dies cause of his own fault (kills himself by jumping down from too high up for instance) the sound "monsterkill" plays (what I don't want) and it plays at almost 3 times the normal game volume !? The monsterkill also plays when someone is on a monsterkill and then it sounds normal, so it's not the csv file.
Anyone have an idea on how to fix this ?
Here is the relevant code;
added two lines in the DM script ;
Code: Select all
dummy()
{
waittillframeend;
if(isdefined(self))
level notify("connecting", self);
}
Callback_PlayerConnect()
{
thread dummy();
/////////////////////////////////////////////////////////////
self.pers["kill_spree"] = 0;
/////////////////////////////////////////////////////////////
self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
level notify("connected", self);
if(!level.splitscreen)
iprintln(&"MP_CONNECTED", self);
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
Code: Select all
Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
self endon("spawned");
self notify("killed_player");
if(self.sessionteam == "spectator")
return;
// If the player was killed by a head shot, let players know it was a head shot kill
if(sHitLoc == "head" && sMeansOfDeath != "MOD_MELEE")
sMeansOfDeath = "MOD_HEAD_SHOT";
/////////////////////////////////////////////////////
thread maps\mp\_headshot::Messages(sMeansOfDeath, attacker);
/////////////////////////////////////////////////////
// send out an obituary message to all clients about the kill
obituary(self, attacker, sWeapon, sMeansOfDeath);
self maps\mp\gametypes\_weapons::dropWeapon();
self maps\mp\gametypes\_weapons::dropOffhand();
self.sessionstate = "dead";
self.statusicon = "hud_status_dead";
if(!isdefined(self.switching_teams))
self.deaths++;
The _headshot script;
Code: Select all
Messages(sMeansOfDeath, attacker)
{
killcount = undefined;
self.pers["kill_spree"] = 0;
//if(getCvar("spree") == "")
// setCvar("spree", "0");
if(sMeansOfDeath == "MOD_HEAD_SHOT")
{
distance = distance(Attacker.origin , self.origin); //Inches
meters = distance * 0.0254; //Meters
feet = distance / 12; //Feet
if(!isDefined("shm_metric") || getcvar("shm_metric") == "")
setcvar("shm_metric", "meters");
if(getCVar("shm_metric") != "feet")
{
attacker playlocalSound("headshot");//voice message to attacker
self playlocalSound("headshot"); //voice message to dead person
}
}
attacker.pers["kill_spree"]++;//this is ok
killcount = attacker.pers["kill_spree"];
if(killcount == 3)
{
//iprintln(killcount);
iprintln("^5" + attacker.name + "^7 is on a ^1killing spree!");
//playSoundOnPlayers("killingspree");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is on a ^1Killingspree!");
self playlocalSound("killingspree");
attacker playlocalSound("killingspree");
}
if(killcount == 4)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is ^1Dominating!");
//playSoundOnPlayers("dominating");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is ^1Dominating!");
self playlocalSound("dominating");
attacker playlocalSound("dominating");
}
if(killcount == 5)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is ^1Unstoppable!");
attacker iprintlnBold("^1Unstoppable!");
//playSoundOnPlayers("unstoppable");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is ^1Unstoppable!");
self playlocalSound("unstoppable");
attacker playlocalSound("unstoppable");
}
if(killcount == 6)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is ^1Godlike!");
attacker iprintlnBold("^1You ^7are ^1Godlike!");
//playSoundOnPlayers("godlike");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is ^1Godlike!");
self playlocalSound("godlike");
attacker playlocalSound("godlike");
}
if(killcount == 7)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 8)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 9)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 10)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 11)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is still on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is still on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 12)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is still on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is still on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 13)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is still on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is still on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 14)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is still on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is still on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
if(killcount == 15)
{
//iprintln(killcount);
iprintln("^1" + attacker.name + "^7 is still on a ^1Monsterkill!");
attacker iprintlnBold("^1Monsterkill!");
//playSoundOnPlayers("monsterkill");
self iprintlnBold("^1You ^7are killed by ^1" + attacker.name + "^7 who is still on a ^1Monsterkill!");
self playlocalSound("monsterkill");
attacker playlocalSound("monsterkill");
}
}
playSoundOnPlayers(sound, team)
{
players = getentarray("player", "classname");
if(level.splitscreen)
{
if(isdefined(players[0]))
players[0] playLocalSound(sound);
}
else
{
if(isdefined(team))
{
for(i = 0; i < players.size; i++)
{
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == team))
players[i] playLocalSound(sound);
}
}
else
{
for(i = 0; i < players.size; i++)
players[i] playLocalSound(sound);
}
}
}