Author Topic: longest headshot and longest shot  (Read 4792 times)

Offline TCA-Scottmann

  • Rank: Private
  • *
  • Posts: 1
longest headshot and longest shot
« on: August 13, 2008, 03:01:01 pm »
First of all we will open extreme\_ex_hudstats.gsc

at lines 54 and 55 i changed the knive to this

self.hud_stats.label = &"^4LONGEST HEADSHOT:";
self.hud_stats setvalue(self.pers["longhead"]);

at lines 67 adn 68 i changed the nade to this

self.hud_stats.label = &"^4LONGEST SHOT:";
self.hud_stats setvalue(self.pers["longshot"]);

at lines 187 to 202 i changed the knive entry to this

if(!isdefined(self.hud_statslonghead))
{
self.hud_statslonghead = newClientHudElem(self);
self.hud_statslonghead.x = level.ex_hudstatsuse_xpos;
self.hud_statslonghead.y = level.ex_hudstatsuse_ypos + 32;
self.hud_statslonghead.alignx = "right";
self.hud_statslonghead.aligny = "middle";
self.hud_statslonghead.horzAlign = "fullscreen";
self.hud_statslonghead.vertAlign = "fullscreen";
self.hud_statslonghead.alpha =0.8;
self.hud_statslonghead.fontScale = 1.4;
self.hud_statslonghead.color = (1, 0, 0);
}

self.hud_statslonghead.label = &"^4LONGEST HEADSHOT:";
self.hud_statslonghead setvalue(self.pers["longhead"]);

at lines 204 to 219 i changed the nade entry to this

if(!isdefined(self.hud_statslongshot))
{
self.hud_statslongshot = newClientHudElem(self);
self.hud_statslongshot.x = level.ex_hudstatsuse_xpos;
self.hud_statslongshot.y = level.ex_hudstatsuse_ypos + 48;
self.hud_statslongshot.alignx = "right";
self.hud_statslongshot.aligny = "middle";
self.hud_statslongshot.horzAlign = "fullscreen";
self.hud_statslongshot.vertAlign = "fullscreen";
self.hud_statslongshot.alpha =0.8;
self.hud_statslongshot.fontScale = 1.4;
self.hud_statslongshot.color = (1, 0, 0);
}

self.hud_statslongshot.label = &"^4LONGEST SHOT:";
self.hud_statslongshot setvalue(self.pers["longshot"]);

at lines 294 to 295 i added this above the } that was there

if(isDefined(self.hud_statslonghead)) self.hud_statslonghead destroy();
if(isDefined(self.hud_statslongshot)) self.hud_statslongshot destroy();




Next i opened maps\mp\gametypes\_stats.gsc

from lines 126 to 160 i INSERTED (I REPEAT INSERTED)

self.hud_longhead = newClientHudElem(self);
self.hud_longhead.archived = false;
self.hud_longhead.x = 1;
self.hud_longhead.y = 135;
self.hud_longhead.sort = 10;
self.hud_longhead.fontscale = 1.4;
self.hud_longhead setText("^2Longest Headshot:");
self.hud_longhead.glowColor = (0.2, 0.3, 0.7);
self.hud_longhead.glowAlpha = 1;
self.hud_longhead_num = newClientHudElem(self);
self.hud_longhead_num.archived = false;
self.hud_longhead_num.x = 65;
self.hud_longhead_num.y = 135;
self.hud_longhead_num.sort = 10;
self.hud_longhead_num.fontscale = 1.4;
self.hud_longhead_num.glowColor = (0.2, 0.3, 0.7);
self.hud_longhead_num.glowAlpha = 1;

self.hud_longshot = newClientHudElem(self);
self.hud_longshot.archived = false;
self.hud_longshot.x = 1;
self.hud_longshot.y = 120;
self.hud_longshot.sort = 10;
self.hud_longshot.fontscale = 1.4;
self.hud_longshot setText("^2Longest Headshot:");
self.hud_longshot.glowColor = (0.2, 0.3, 0.7);
self.hud_longshot.glowAlpha = 1;
self.hud_longshot_num = newClientHudElem(self);
self.hud_longshot_num.archived = false;
self.hud_longshot_num.x = 65;
self.hud_longshot_num.y = 120;
self.hud_longshot_num.sort = 10;
self.hud_longshot_num.fontscale = 1.4;
self.hud_longshot_num.glowColor = (0.2, 0.3, 0.7);
self.hud_longshot_num.glowAlpha = 1;


then on lines 228 to 231 i inserted

self.hud_longhead_num.alpha = 0;
self.hud_longhead.alpha = 0;
self.hud_longshot_num.alpha = 0;
self.hud_longshot.alpha = 0;


on lines 251 to 254 i inserted

self.hud_longhead_num.alpha = 1;
self.hud_longhead.alpha = 1;
self.hud_longshot_num.alpha = 1;
self.hud_longshot.alpha = 1;

on lines 272 to 275 i inserted

if(isDefined(self.longhead))
self.hud_longhead_num setValue(self.longhead);
if(isDefined(self.longshot))
self.hud_longshot_num setValue(self.longshot);

Next we open maps\mp\gametypes\_globallogic.gsc

at lines 3811 to 3815 i added

self initPersStat( "longhead" );
self.longhead = self getPersStat( "longhead" );

self initPersStat( "longshot" );
self.longshot = self getPersStat( "longshot" );

Next we open extreme\_ex_obituary.gsc


at lines 598 to 600 i added

attacker thread obitlongstat("longdist", calcdist);
if(sHitloc == "head") attacker thread obitlongstat("longhead", calcdist);
else attacker thread obitlongstat("longshot", calcdist);

Next we open extreme\_ex_varcache.gsc

at lines 620 to 625 i have this (not sure if theres not a better way)

// X4 Knife/Headshot/Grenade Counter
//****************************************************************************
level.ex_showlongheadcalcdist = [[level.ex_dvardef]] ("ex_show_longhead_calcdist", 0, 0, 1, "int");
level.ex_showheadcount = [[level.ex_dvardef]] ("ex_show_head_count", 0, 0, 1, "int");
level.ex_showheadbold = [[level.ex_dvardef]] ("ex_show_head_bold", 0, 0, 1, "int");
level.ex_showlongshotcalcdist = [[level.ex_dvardef]] ("ex_show_longshot_calcdist", 0, 0, 1, "int");


Next we open extreme\_ex_hud.gsc

at lines 66 to 67 i put this

if(isDefined(self.hud_statslonghead)) self.hud_statslonghead destroy();
if(isDefined(self.hud_statslongshot)) self.hud_statslongshot destroy();



this is my first attempt at modding something myself so u might want to wait for joker or someone else with more experience to look it over i dont know enought to know if i made any major mistakes that could bite me later on
but for now this is working well on my server

and dont let me forget to mention that this is off of the extreme mod i just modified some of it they did the work

Offline Cleav420

  • Rank: Private
  • *
  • Posts: 15
longest headshot and longest shot
« Reply #1 on: August 17, 2008, 12:45:31 am »
Hey thx man for helping me out on this it works great 8)

Offline dkrysak

  • Rank: Private
  • *
  • Posts: 2
longest headshot and longest shot
« Reply #2 on: August 17, 2008, 02:28:41 pm »
Hi guys
Thanx for putting this up
Is it for the Extreme v1 or v2 ?
i aint got a clue im learning  :oops:

Offline TCA-Scottmann

  • Rank: Private
  • *
  • Posts: 1
longest headshot and longest shot
« Reply #3 on: August 17, 2008, 02:35:52 pm »
i used it on v2

Offline Kenny

  • Rank: Private
  • *
  • Posts: 22
    • http://www.codsnipers.co.uk
longest headshot and longest shot
« Reply #4 on: August 17, 2008, 06:42:52 pm »
Great tut m8 . Works a charm on V2

You've no idea how long i've spent trying to get this workin. Since cod2 i think .  :?  :?

Again top work m8  :D

Offline TCA-Scottmann

  • Rank: Private
  • *
  • Posts: 1
longest headshot and longest shot
« Reply #5 on: August 19, 2008, 03:19:02 pm »
made a slight change so that the longest hs if its longer than the longest shot registers for both


Next we open extreme\_ex_obituary.gsc


at lines 598 to 600 i changed to this



Code: [Select]
attacker thread obitlongstat("longdist", calcdist);
if(sHitloc == "head") attacker thread obitlongstat("longhead", calcdist);
if(sHitLoc != "none") attacker thread obitlongstat("longshot", calcdist);

Offline dvsdeadman

  • Rank: Private
  • *
  • Posts: 19
longest headshot and longest shot
« Reply #6 on: August 30, 2008, 05:47:56 pm »
is there any why to show who has the longest shot?

Offline The_Undertaker

  • Rank: Private
  • *
  • Posts: 31
    • http://www.majorbums.net
longest headshot and longest shot
« Reply #7 on: September 01, 2008, 03:49:00 am »
what if you want to use this on a R&G server where also nades and knives are enabled?
do you have to change the nade and knife entries too or do you need to add it?

greets

Offline TCA-Scottmann

  • Rank: Private
  • *
  • Posts: 1
longest headshot and longest shot
« Reply #8 on: September 04, 2008, 03:48:57 pm »
just add it to it without changing as far as showing who had the longest shot i think i read on the forums here that this is going to be in the works for the next extreme they actually know what there doing so its probably better to wait for them  :)

Offline The_Undertaker

  • Rank: Private
  • *
  • Posts: 31
    • http://www.majorbums.net
longest headshot and longest shot
« Reply #9 on: September 06, 2008, 06:41:30 am »
thanks for the reply i will try it and if it will not work then i will wait for the crew to put it in

greets

Offline The_Undertaker

  • Rank: Private
  • *
  • Posts: 31
    • http://www.majorbums.net
Re: longest headshot and longest shot
« Reply #10 on: November 01, 2008, 06:39:09 am »
we changed one of our servers to a sniper server so i thought let's try this option again and it works but i seem to have missed something i think. if not then sorry.

i did all what the tut is telling me, but it does not tell globally that there was a long(head)shot beeing made at the top of the screen like when you are having when you get a killspree or when you make a headshot. i would like it that way very much so if someone could help me out or can point me to the right direction i would be a very happy camper



greets

Offline HKSPreDaToR

  • Rank: Private
  • *
  • Posts: 33
    • http://www.hks-hukkers.net
Re: longest headshot and longest shot
« Reply #11 on: November 26, 2008, 07:24:52 pm »
Can't get this to work. Tried twice and server crashes. The line numbers on MS Word don't match to your's and I put them in the closet place according to your description. Can you set up a better way to edit the files or I can PM you mine and take a crack at it.

Thanks

Offline TCA-Scottmann

  • Rank: Private
  • *
  • Posts: 1
Re: longest headshot and longest shot
« Reply #12 on: January 29, 2009, 12:27:38 pm »
Not to sound wierd here but, I am the former TCA-Scottmann who has changed his tags to SAW-Scottmann.  I have never made this post and am curious to who made this post under the same name?  Normally I would say what a coincidence however, to be from the same "small" home town and to have been the "only" Scottmann to wear TCA tags while this was posted.  Make no worries I'm proud that whoever did this is helping people out and not doing something in vane (so far so good).  If you are a true TCA-Scottmann (from New Braunfels, Texas), please let me know where in this small town you are so we can play some cod and drink some brew!  Seems like we have a whole bunch in common!!  LOL

Scottmann