Author Topic: Death Information  (Read 11058 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 »

Offline rumpel

  • Camper
  • ***
  • Posts: 410
Re: Death Information
« Reply #20 on: March 29, 2008, 02:48:19 pm »
works fine on windows and on selfkill :d
banned.

Offline VenTeR

  • Major(1)
  • Posts: 5
Re: Death Information
« Reply #21 on: March 30, 2008, 03:20:04 am »
hah!:)very fun,but server shutdown!!!!

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #22 on: March 30, 2008, 04:51:25 pm »
hah!:)very fun,but server shutdown!!!!
Then you did something wrong.
I just tested to see if it compiles, which it does.

make sure the server starts w/out the script, if not, get a fresh new server and modify soldat.ini and test again..
create a folder under the scripts folder, name it "Death Info"
Inside Death Info....
create a file Includes.txt and inside that put "core.pas"
create a file core.pas and inside that, paste the code.

Offline Miszkol_

  • Major(1)
  • Posts: 30
  • The Piccolo Power xD
Re: Death Information
« Reply #23 on: April 22, 2008, 04:03:10 pm »
1. My server config:
- Counter-Strike script v1.01
- realistic mode - on
- Survival mode - on
- (...and more scripts. This is important scripts on my server, but i think Death Info script may collide with that scripts.)

2. When someone kill someone Info of Death only flash on screen (least on my screen) and disappear...
I think this script maybe collide with other scripts.

3. ...And IMPORTANT something:
I have a Idea :):
When someone want Info of dead to write command /me or /deadinfo or ...
Only someone want to get info to write command. I think it's better result and don't do chaos on screen... ;D

H.E.L.P M.E
English is hard language, please forget my bad :P

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #24 on: April 22, 2008, 07:28:22 pm »
Miszkol_, the problem is that only one message may be on the screen at a time. The Counter-Strike script draws a person's amount of money every second, and this script is trying to draw the text right after a person dies, so it gives the person less than a second to see.
A way to fix this is by having the script only update everybody's cash every few seconds, or I could modify this script to use WriteConsole instead (draw's in the person's console) (much easier) of DrawText, which i just did:
Code: [Select]
var
  Realistic: boolean;
  Hits: array[1..32] of array[1..32] of byte;
  Dmg: array[1..32] of array[1..32] of longint;

procedure ActivateServer();
begin
  if StrtoInt(ReadINI('Soldat.ini','GAME','Realistic_Mode','0')) = 1 then Realistic := true else Realistic := false;
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var
  i: byte;
begin
  if Killer <> Victim then begin
    WriteConsole(Victim, GetPlayerStat(Killer, 'Name') + ' killed you with ' + iif(Hits[Victim][Killer] = 1,'1 hit using ', InttoStr(Hits[Victim][Killer]) + ' hits using ') + Weapon, $FF000000);
    WriteConsole(Victim, 'You hurt him using ' + iif(Hits[Killer][Victim] = 1, '1 hit doing ', InttoStr(Hits[Killer][Victim]) + ' hits doing ') + iif(Realistic, InttoStr(Round(1.54 * Dmg[Killer][Victim])), InttoStr(Dmg[Killer][Victim])) + '% damage', $FF000000);
    for i := 1 to 32 do begin
      Hits[Victim][i] := 0;
      Dmg[Victim][i] := 0;
    end;
  end;
end;

function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  Result := Damage;
  Hits[Victim][Shooter] := Hits[Victim][Shooter] + 1;
  if Damage <= GetPlayerStat(Victim,'Health') then Dmg[Victim][Shooter] := Dmg[Victim][Shooter] + Damage else Dmg[Victim][Shooter] := Dmg[Victim][Shooter] + GetPlayerStat(Victim,'Health');
end;

procedure OnPlayerRespawn(ID: byte);
var
  i: byte;
begin
  for i:= 1 to 32 do begin
    Dmg[i][ID] := 0;
    Hits[i][ID] := 0;
  end;
end;

Offline Miszkol_

  • Major(1)
  • Posts: 30
  • The Piccolo Power xD
Re: Death Information
« Reply #25 on: April 23, 2008, 03:15:45 am »
Thx it's better but i see bugs:
- Whan some1 kill some1 with usscom on screen write "selfkill"...
- Can you do some1 write commend "/me" or "/deadinfo" to look dead info
- please change color massage black to red

(I can't write script :'()

English is hard language, please forget my bad :P

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #26 on: April 23, 2008, 02:48:32 pm »
- Whan some1 kill some1 with usscom on screen write "selfkill"...
soldat server seems to give inaccurate info about who kills who with what when it comes to the ussocom :P I can add a manual check to replace "Selfkill" with "USSOCOM" though

- Can you do some1 write commend "/me" or "/deadinfo" to look dead info
How would this work exactly? If player A kills player B, then when player B does /deadinfo, it regives him the info of the last player who killed him (player A)?

Offline Miszkol_

  • Major(1)
  • Posts: 30
  • The Piccolo Power xD
Re: Death Information
« Reply #27 on: April 24, 2008, 07:43:52 am »
- Whan some1 kill some1 with usscom on screen write "selfkill"...
soldat server seems to give inaccurate info about who kills who with what when it comes to the ussocom :P I can add a manual check to replace "Selfkill" with "USSOCOM" though

- Can you do some1 write commend "/me" or "/deadinfo" to look dead info
How would this work exactly? If player A kills player B, then when player B does /deadinfo, it regives him the info of the last player who killed him (player A)?

Yes.
When I write command /deadinfo i want description of my dead AND ONLY IF I WRITE IT, because on my server is more massages(when i win money[cs script] and more more others massages...)
Can you do this script description of ALL people which I shooting ?? Example:
You Give:
- 1 bullet of Desert eagle and 30% hp  to xXx
- 3 bullets of Ak-74 and 110% hp to yYy and Dead

You take:
-  1 bullet of berret and 200% hp and Dead ^^

Can you do it??
« Last Edit: April 24, 2008, 03:28:23 pm by Miszkol_ »
English is hard language, please forget my bad :P

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #28 on: April 24, 2008, 08:14:56 pm »
- Whan some1 kill some1 with usscom on screen write "selfkill"...
soldat server seems to give inaccurate info about who kills who with what when it comes to the ussocom :P I can add a manual check to replace "Selfkill" with "USSOCOM" though

- Can you do some1 write commend "/me" or "/deadinfo" to look dead info
How would this work exactly? If player A kills player B, then when player B does /deadinfo, it regives him the info of the last player who killed him (player A)?

Yes.
When I write command /deadinfo i want description of my dead AND ONLY IF I WRITE IT, because on my server is more massages(when i win money[cs script] and more more others massages...)
Can you do this script description of ALL people which I shooting ?? Example:
You Give:
- 1 bullet of Desert eagle and 30% hp  to xXx
- 3 bullets of Ak-74 and 110% hp to yYy and Dead

You take:
-  1 bullet of berret and 200% hp and Dead ^^

Can you do it??

Would probably be smarter for me to just remake the script...
I can't do it now, and won't be able to start until at least saturday night fyi...

Offline Miszkol_

  • Major(1)
  • Posts: 30
  • The Piccolo Power xD
Re: Death Information
« Reply #29 on: April 25, 2008, 02:05:18 am »
OK i wait to saturdey's night for this script.
English is hard language, please forget my bad :P

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #30 on: April 27, 2008, 11:31:38 am »
OK i wait to saturdey's night for this script.
sunday* I fell asleep as early as 8:30 PM and woke up around noon ^^
How do you want it to work? Should it act like a log? Or should it accumulate per person? (log-like may be long, and spam-like; i wouldn't suggest that) Resetting after you respawn, or only on map change?

Offline Miszkol_

  • Major(1)
  • Posts: 30
  • The Piccolo Power xD
Re: Death Information
« Reply #31 on: April 27, 2008, 01:21:47 pm »
OK i wait for this...
I want :
- When I WANT(no when i dead) see my "shooting Information" I write command :
 
  • /shootinfo - to see my shooting with ALL to i shooting on NOW round and LAST round. If you are dead, script display info about round before dead. Example:


Now Round:
 You given damage:
 - Father - 1 shot, M72 LAW, 200% hp, Dead.

 You taken damage:
 - Major - 1 shot, berret M82A1, 100% hp, Dead.

Reset this info after next round start.

 
  • /shootinfoall - to see shooting info for all rounds. Script display this too on end map or change.  Example:


 All Round :
 You given Damage:
 - Mother - 30 shots ; Weapons: Berret M82A1, AK-74 ; 666% hp, 7 Deads.

 You taken damage:
 - Major - 8 shot ; Weapons: Berret M82A1 ; 800% hp; 8 Deads.

Don't resetting this to change map.
------------------------------------------------
You understand??
Can you do it??
How long i must wait for this??

BB.

       
English is hard language, please forget my bad :P

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #32 on: April 27, 2008, 08:28:18 pm »
Miszkol_: http://forums.soldat.pl/index.php?topic=26689
Make sure you download the survival version.
Commands are /report and /overall

Offline Mushroom

  • Major(1)
  • Posts: 3
Re: Death Information
« Reply #33 on: April 29, 2008, 04:57:50 pm »
Hey, i hope you can help me with this mistake:
Code: [Select]
[*] Compiling DeathInfo -> core.pas...
 [*] DeathInfo -> [Error] (15:92): String error
 [*] DeathInfo -> [Error] (15:92): Syntax error

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #34 on: May 02, 2008, 04:31:30 pm »
Hey, i hope you can help me with this mistake:
Code: [Select]
[*] Compiling DeathInfo -> core.pas...
 [*] DeathInfo -> [Error] (15:92): String error
 [*] DeathInfo -> [Error] (15:92): Syntax error
I zipped the original script, so try just extracting that into your scripts folder.

Offline Zhul

  • Major(1)
  • Posts: 17
Re: Death Information
« Reply #35 on: May 03, 2008, 04:18:09 am »
it doesnt show with witch weapon you hit the guy that kills you :(

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #36 on: May 03, 2008, 08:18:06 am »
it doesnt show with witch weapon you hit the guy that kills you :(
Oh, no; you know what weapon you hit them with so no need for that :P
Unless you have an extremely poor memory and can't remember literally 1 second ago when you were alive what weapon you had ^^

Offline Mushroom

  • Major(1)
  • Posts: 3
Re: Death Information
« Reply #37 on: May 03, 2008, 01:33:09 pm »
Thank you, now it works :D

EDIT: How can I change the text color ?
« Last Edit: May 03, 2008, 01:47:36 pm by Mushroom »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #38 on: May 03, 2008, 09:30:41 pm »
Thank you, now it works :D

EDIT: How can I change the text color ?
You have to know a little bit about hex and how colors work in hex...
find "$FF000000" in the script...
if you don't know anthing about hex, then google hexadecimal colors or something like that
you will notice that you will get 6 length hex number... put a $ the the left of it, and replace the old one with the new one

Offline Mushroom

  • Major(1)
  • Posts: 3
Re: Death Information
« Reply #39 on: May 04, 2008, 05:57:24 am »
OK thank you it works but i think the font is not so good. Its hard to read. Is there an possibility to change the font ?

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Death Information
« Reply #40 on: May 04, 2008, 10:11:22 am »
Thats the client's choice...
You can change the size of the font though.. On the same like as the color, change "0.06" (third argument from the back) to whatever number you wish, larger number, larger the text.