Can you include fun messages for when someone makes a headshot? And if someone falls to their death?
Both are things that are logged so it should be possible right?
Can you include fun messages for when someone makes a headshot? And if someone falls to their death?
Both are things that are logged so it should be possible right?
Yes I've actually done this with Nutshots, I don't see why you couldn't do it for Headshots, or Falling...
However I do not mod mods very well, especially ones that are made sorta confusing (I've only been using this for like 3 days now, so it could just be me), but I'll attatch the file, and explain what to change if you want either of these, or both to happen, however I have yet to figure out how to be able to add things to the config, so your going to have to edit class files, If you are not comfortable doing this I suggest you stop reading
FOR HEADSHOT MESSAGE
Open adminmod/classes/mod.class.php
FIND: Around Line 680
if ($killer_guid != "" && !array_key_exists($killer_guid, $this->players)) {
$this->logging->write(MOD_WARNING, "DEATH by player '$killer_name' who is actually not on the server: PID: $killer_pid, GUID: $killer_guid");
return;
}
ADD BELOW
$killfind = array("<KILLER_NAME>",
"<VICTIM_NAME>",);
$killreplace = array($killer_name,
$victim_name,);
if($image == "MOD_HEAD_SHOT"){
$message = "Change this to your will"; //You may use variables <KILLER_NAME> and <VICTIM_NAME>
$parsed = str_replace($killfind,$killreplace,$message);
$mod->rconSay($parsed);
}
Save + Upload adminmod/classes/mod.class.php
This will send a the message that is set by the variable $message (which should be in bold above) when a person gets a head shot, you may edit this however you want, but you can not use double quotes (") anywhere in the message, and you must surround the message with double quotes ("). You may use the variables <KILLER_NAME> to show the killers name, and <VICTIM_NAME> to show the victim's name.
FOR FALLING MESSAGE
Open adminmod/classes/mod.class.php
FIND: Around Line 680
if ($killer_guid != "" && !array_key_exists($killer_guid, $this->players)) {
$this->logging->write(MOD_WARNING, "DEATH by player '$killer_name' who is actually not on the server: PID: $killer_pid, GUID: $killer_guid");
return;
}
ADD BELOW
$killfind = array("<VICTIM_NAME>",);
$killreplace = array($victim_name,);
if($image == "MOD_FALLING"){
$message = "Change this to your will"; //You may use variable <VICTIM_NAME>
$parsed = str_replace($killfind,$killreplace,$message);
$mod->rconSay($parsed);
}
Save + Upload adminmod/classes/mod.class.php
This will send a the message that is set by the variable $message (which should be in bold above) when a person gets a falls to their death, you may edit this however you want, but you can not use double quotes (") anywhere in the message, and you must surround the message with double quotes ("). You may use the variable <VICTIM_NAME> to show the victim's name, however because there is no killer, you may NOT use <KILLER_NAME>.
Hope this helps,
Jchamb2010
Changing Core Files could end up in missing support here.
Better make a solution with plugin files.