Author |
Topic: how determine the body part where bullet was shot |
saqibvohra93 |
General Member Since: Feb 24, 2015 Posts: 3 Last: Feb 25, 2015 [view latest posts] |
|
|
|
DrBiggzz |
|
General Member Since: Apr 9, 2007 Posts: 98 Last: Sep 24, 2022 [view latest posts] |
|
|
|
|
|
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
|
saqibvohra93 |
General Member Since: Feb 24, 2015 Posts: 3 Last: Feb 25, 2015 [view latest posts] |
|
|
|
TrikX |
|
General Member Since: Jul 7, 2012 Posts: 129 Last: Dec 31, 2016 [view latest posts] |
|
|
|
DrBiggzz |
|
General Member Since: Apr 9, 2007 Posts: 98 Last: Sep 24, 2022 [view latest posts] |
|
|
|
|
Category: CoD4 Map + Mod Releases Posted: Wednesday, Feb. 25, 2015 12:04 am |
|
in call of duty uo the hitlocations are as follows
Code: getHitLocName(hitloc)
{
switch(hitloc)
{
case "right_hand": return "Right Hand";
case "left_hand": return "Left Hand";
case "right_arm_upper": return "Right Upper Arm";
case "right_arm_lower": return "Right Forearm";
case "left_arm_upper": return "Left Upper Arm";
case "left_arm_lower": return "Left Forearm";
case "head": return "Head";
case "neck": return "Neck";
case "right_foot": return "Right Foot";
case "left_foot": return "Left Foot";
case "right_leg_lower": return "Right Lower Leg";
case "left_leg_lower": return "Left Lower Leg";
case "right_leg_upper": return "Right Upper Leg";
case "left_leg_upper": return "Left Upper Leg";
case "torso_upper": return "Upper Torso";
case "torso_lower": return "Lower Torso";
case "none": return "Pelvis";
default: return hitloc;
}
}
^^now im not sure but i believe most cods use these body tags.^^
Code: // 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";
/*=============Added By C()D3R=============*/
// Shows All That A Player Got A Headshot, Bash Kill Or Grenade/Satchel Kills.
// Sets The Points For A Headshot To Be Worth 2.
// Shows All That A Player Committed Suicide.
{
if(sMeansOfDeath == "MOD_HEAD_SHOT")
{
attacker.score++;
attacker.pers["headshots"]++;
iprintlnbold(attacker.name + " ^3Scored A HeadShot On " + self.name + "");
attacker iprintln("^1[^3HeadShot^1]^2Gained ^12^2Points!");
maps\mp\antic\_antic::popHead(damageDir, damage);
}
here is also a snippet of my headshots script this gives the player 2 points and displays that he scored a headshot.
there are easier ways to bring up the hitlocations but this is the method i currently use. I will post another method using the obituary to give detailed information about kills. once i script one up and get it working correctly.
edited on Feb. 24, 2015 05:29 pm by DrBiggzz
edited on Feb. 24, 2015 05:40 pm by DrBiggzz |
|
|
|
.KiLL3R. |
|
General Member Since: Oct 26, 2006 Posts: 1437 Last: Jul 3, 2017 [view latest posts] |
|
|
Category: CoD4 Map + Mod Releases Posted: Wednesday, Feb. 25, 2015 12:23 am |
|
saqibvohra93 writes...Quote:
@trinkx, thanks for your detailed reply. But I cant figure out how using the model I can detect the part and send signal to a background process running.
If I can able to find that model, then how can I actually detect that this body part was hit, If I can print it in the console or anywhere from where I can detect easily. Can you help me with anything?
You will have to make a mod that prints to a log file (using the logPrint() function) whenever a player is hit and then have your program monitor that log file.
The log file it prints to is set by the g_log setting, usually set to "games_mp.log" and located in the mod directory. You also need to make sure g_logSync is set to "2" so that data is written immediately. |
|
|
|
DrBiggzz |
|
General Member Since: Apr 9, 2007 Posts: 98 Last: Sep 24, 2022 [view latest posts] |
|
|
|
|
|
saqibvohra93 |
General Member Since: Feb 24, 2015 Posts: 3 Last: Feb 25, 2015 [view latest posts] |
|
|
|