Author Topic: Death Information  (Read 11151 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Death Information
« on: June 12, 2007, 02:57:23 pm »
Script Name: Death Information
Script Description: The script shows who killed you, what they killed you with, with how many bullets did they kill you with, how many times you hit them, and how much damage (%) you dealt to him.
Original Author: Curt (DorkeyDear)
Core Version: 2.6.1

Note: The ThreadFunc procedure is sometimes buggy and the script may not always show the information.
« Last Edit: May 03, 2008, 08:06:06 am by DorkeyDear »

Offline KeYDoN

  • Major
  • *
  • Posts: 60
Re: Death Info
« Reply #1 on: June 12, 2007, 09:04:50 pm »
nice idea but...
1. omg indent your code propely
2. Dont read the INI on every kill, it will stay the same! read it once at startup^^
3. 13*20 is 260 dont calculate it everytime^^

Offline mxyzptlk

  • Veteran
  • *****
  • Posts: 1493
  • The Panda Ninja
Re: Death Info
« Reply #2 on: June 12, 2007, 09:07:40 pm »
3. Maybe it calculates as Dmg[Killer][Victim] / 13 * 20, straight across. If it follows Order of Ops, it would.
As in: (Dmg[Killer][Victim] / 13)* 20

"While preceding your entrance with a grenade is a good tactic in
Quake, it can lead to problems if attempted at work." -- C Hacking

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Info
« Reply #3 on: June 12, 2007, 09:32:49 pm »
KeYDoN:
1. I like 2 spaces for indenting. A tab is wayyyyyy too far out and 4 indents sometimes goes out too far for code with a lot of ifs, fors, whiles, then/do begin..ends.
2. Fixed
3. Reordered to make it multiply first. I thought that the order of operations always divided first so it didn't matter, but just in case, I moved it.
« Last Edit: June 12, 2007, 09:39:53 pm by DorkeyDear »

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Death Info
« Reply #4 on: June 13, 2007, 12:14:05 am »
3. Maybe it calculates as Dmg[Killer][Victim] / 13 * 20, straight across. If it follows Order of Ops, it would.
As in: (Dmg[Killer][Victim] / 13)* 20
nice idea but...
1. omg indent your code propely
2. Dont read the INI on every kill, it will stay the same! read it once at startup^^
3. 13*20 is 260 dont calculate it everytime^^

Multiplication and division have the same precedence; and when encountered in a line should be parsed left to right.
The order of multiplication and division do not matter, as long as you preserve the correct operands; a / b * c == a * c / b

a / (b * c) is, however, not the same; but a / (b / c) is. so dividing by 260 would be incorrect, but dividing by 0.65 would be correct. Multiplying by aprox 1.54 would also be correct, but, as 20/13 is an infinitely repeating decimal, it's not recommended for computer applications due to precision issues.

As far as indenting goes, in the land of Delphi, 2 spaces is standard.

Offline KeYDoN

  • Major
  • *
  • Posts: 60
Re: Death Information
« Reply #5 on: June 13, 2007, 06:37:09 am »
@3. ah right, my mistake, didn think enough about it ;O
@Dorkey
there i even dont see your lovly 2 spaces :P

Quote
if Damage <= GetPlayerStat(Victim,'Health') then Dmg[Victim][Shooter] := Dmg[Victim][Shooter] + Damage else Dmg[Victim][Shooter] := Dmg[Victim][Shooter] + GetPlayerStat(Victim,'Health');

EDIT: just for info:
Quote
iif(Realistic = true,...
could be shorter
Quote
iif(Realistic,
« Last Edit: June 13, 2007, 06:40:22 am by KeYDoN »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #6 on: June 13, 2007, 11:39:25 am »
UPDATED and CHANGED
Replaced the "20 * Dmg[Killer][Victim] / 13" with "1.54 * Dmg[Killer][Victim]"
Shortened "iif(Realistic = true,..." to "iif(Realistic,..."
« Last Edit: June 13, 2007, 11:41:07 am by DorkeyDear »

Offline ajkilla

  • Major(1)
  • Posts: 49
Re: Death Information
« Reply #7 on: July 04, 2007, 11:58:46 am »
dorkey how come You never pos these In Ds Forum -____- nice script BTW
I OWN U SO JUS LISTEN TO THE SWEET SOUNDS OF....

BOOM HEADSHOT!!!!!!!!!

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #8 on: July 12, 2007, 04:18:43 pm »
Sense... uhh... its ezr to post in just 1 forum :) they shoudl come here if they want scripts.
Eh, could you PM me to remind me latter to post my scripts on DS forums? I may actually do it, just not ATM.

Date Posted: July 04, 2007, 06:32:17 PM
FIXED
  • added a round to the % of player's health so the script works and is an integer.

Offline Flacid Assassin

  • Camper
  • ***
  • Posts: 450
  • Gorby The Grunt
Re: Death Information
« Reply #9 on: December 03, 2007, 02:36:42 am »
this would be good for a CoD 4 Modd ill be working on after my first mod is complete

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Death Information
« Reply #10 on: December 18, 2007, 08:55:08 pm »
can u put this in a .zip?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline Sethamundo

  • Inactive Staff
  • Flagrunner
  • *****
  • Posts: 607
Re: Death Information
« Reply #11 on: February 08, 2008, 08:12:11 am »
Sorry to dig up an old thread, but I'm having some problems.  I've added this script to my server and have traced the problem back down to this script.  I love this script and would like to see it working properly on my server, but currently it grants invincibility!  Gram and I were testing this script and while he could kill me normally, he would recieve no damage at all.  The /kill command would not kill him either, nor admin kill.  After we were done, I played around with it some more alone when my server was empty and I couldn't take any damage at all.  I tried /kill, /mercy grenading myself, adding Boogie Man to chainsaw me, etc.  When adding Boogie Man, he couldn't die either!

Has anyone else encountered this problem?  If so, does anyone know of a fix for it, or is it something that DorkyDear can fix within the code? (I have no scripting knowlage, unfortunately.)
Illumination is not reached by visualizing the light but by exploring the darkness.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #12 on: February 08, 2008, 03:30:10 pm »
Try now. (i changed the code)

Offline Sethamundo

  • Inactive Staff
  • Flagrunner
  • *****
  • Posts: 607
Re: Death Information
« Reply #13 on: February 08, 2008, 05:06:52 pm »
Try now. (i changed the code)
Whatever you did, you fixed it.  Works flawlessly!  Much thanks DorkeyDear.
Illumination is not reached by visualizing the light but by exploring the darkness.

Offline VenTeR

  • Major(1)
  • Posts: 5
Re: Death Information
« Reply #14 on: March 28, 2008, 03:30:31 am »
hm,2.6.3 ,it is possible?

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Death Information
« Reply #15 on: March 28, 2008, 08:30:13 am »
if it worked on february 8th it should still work, yes.

Offline rumpel

  • Camper
  • ***
  • Posts: 410
Re: Death Information
« Reply #16 on: March 28, 2008, 09:11:43 am »
i already tested it: it does work
banned.

Offline VenTeR

  • Major(1)
  • Posts: 5
Re: Death Information
« Reply #17 on: March 29, 2008, 10:27:42 am »
with windows - worked,with linux -not
ideas?

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Death Information
« Reply #18 on: March 29, 2008, 10:42:50 am »
what are the errors..?

Offline VenTeR

  • Major(1)
  • Posts: 5
Re: Death Information
« Reply #19 on: March 29, 2008, 12:54:03 pm »
server shutdown with fatal error

Date Posted: March 29, 2008, 01:51:34 pm
I think,this error in soldat server...
P.S: I have Linux Mandriva 2008
Please help me!
« Last Edit: March 29, 2008, 12:58:14 pm by VenTeR »