Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: Serial K!ller on September 12, 2009, 10:09:14 am

Title: Kill assists
Post by: Serial K!ller on September 12, 2009, 10:09:14 am
Script Name: Kill assists
Script Description Kill assists with minimum damage & timer
Author: Serial killer (http://soldatcentral.com/index.php?page=profile&u=203)
Compile Test: (http://soldatcentral.com/images/pass.gif) Passed
Core Version: 2.6.5
Hosted by: Soldat Central - http://soldatcentral.com/ (http://soldatcentral.com/)

Full Description:
I saw some servers with assist points but there you could win without killing anyone just by spraying because one shot was enough to get a assist point so I made a smarter script where:

- You can set the minimum percentage of damage you have to do to get an assist.
- You can set the maximum time span after you have done damage where you can get an assist.
- Set the amount of assists you have to do to get a kill point.
- Option to enable/disable whether you can get assist after you died.

Ingame message:
(http://img12.imageshack.us/img12/1039/killassist.png)
 



(http://soldatcentral.com/images/download.gif) (http://soldatcentral.com/dl.php?id=137&act=1)
(Size 4.64 KB)
- http://soldatcentral.com/index.php?page=script&f=137 -


** Script hosted by Soldat Central (http://soldatcentral.com/index.php?page=script&f=137)! Please visit the author's script page (http://soldatcentral.com/index.php?page=script&f=137) and Rate this script **
Title: Re: Kill assists
Post by: rayanaga on September 12, 2009, 11:36:45 am
Makes it feel a bit like Team Fortress 2 in a way. :P

I played some of these servers myself with the kill assist and I love it. Great job.
Title: Re: Kill assists
Post by: DarkCrusade on September 13, 2009, 10:39:04 am
It´s cool, I even got assistpoints on that servers for damaging myself with nades and stuff, very funny :)
Title: Re: Kill assists
Post by: Crimson Goth on September 13, 2009, 01:03:18 pm
I dig this script.
Title: Re: Kill assists
Post by: Gizd on September 13, 2009, 03:15:43 pm
Code: [Select]
TextWidth[32] := 103.20;TextWidth[33] := 114.67;TextWidth[34] := 74.53;TextWidth[35] := 5.73;TextWidth[36] := 206.40;
TextWidth[37] := 235.07;TextWidth[38] := 212.13;TextWidth[39] := 40.13;TextWidth[40] := 103.20;TextWidth[41] := 103.20;
TextWidth[42] := 137.60;TextWidth[43] := 229.33;TextWidth[44] := 103.20;TextWidth[45] := 91.73;TextWidth[46] := 103.20;
TextWidth[47] := 97.47;TextWidth[48] := 206.40;TextWidth[49] := 206.40;TextWidth[50] := 206.40;TextWidth[51] := 206.40;
TextWidth[52] := 206.40;TextWidth[53] := 206.40;TextWidth[54] := 206.40;TextWidth[55] := 206.40;TextWidth[56] := 206.40;
TextWidth[57] := 206.40;TextWidth[58] := 103.20;TextWidth[59] := 103.20;TextWidth[60] := 229.33;TextWidth[61] := 229.33;
TextWidth[62] := 229.33;TextWidth[63] := 177.73;TextWidth[64] := 275.20;TextWidth[65] := 200.67;TextWidth[66] := 212.13;
TextWidth[67] := 206.40;TextWidth[68] := 223.60;TextWidth[69] := 194.93;TextWidth[70] := 177.73;TextWidth[71] := 223.60;
TextWidth[72] := 235.07;TextWidth[73] := 97.47;TextWidth[74] := 183.47;TextWidth[75] := 200.67;TextWidth[76] := 177.73;
TextWidth[77] := 246.53;TextWidth[78] := 229.33;TextWidth[79] := 235.07;TextWidth[80] := 200.67;TextWidth[81] := 235.07;
TextWidth[82] := 212.13;TextWidth[83] := 212.13;TextWidth[84] := 160.53;TextWidth[85] := 223.60;TextWidth[86] := 189.20;
TextWidth[87] := 235.07;TextWidth[88] := 194.93;TextWidth[89] := 183.47;TextWidth[90] := 189.20;TextWidth[91] := 103.20;
TextWidth[92] := 97.47;TextWidth[93] := 103.20;TextWidth[94] := 275.20;TextWidth[95] := 137.60;TextWidth[96] := 137.60;
TextWidth[97] := 172;TextWidth[98] := 172;TextWidth[99] := 172;TextWidth[100] := 200.67;TextWidth[101] := 160.53;
TextWidth[102] := 149.07;TextWidth[103] := 183.47;TextWidth[104] := 189.20;TextWidth[105] := 74.53;TextWidth[106] := 154.80;
TextWidth[107] := 166.27;TextWidth[108] := 149.07;TextWidth[109] := 206.40;TextWidth[110] := 189.20;TextWidth[111] := 189.20;
TextWidth[112] := 166.27;TextWidth[113] := 189.20;TextWidth[114] := 166.27;TextWidth[115] := 177.73;TextWidth[116] := 143.33;
TextWidth[117] := 183.47;TextWidth[118] := 160.53;TextWidth[119] := 200.67;TextWidth[120] := 160.53;TextWidth[121] := 154.80;
TextWidth[122] := 172;TextWidth[123] := 137.60;TextWidth[124] := 137.60;TextWidth[125] := 137.60;TextWidth[126] := 229.33;
TextWidth[127] := 166.27;
Idk what this does but I'm 99% sure it can be done otherwise...
Title: Re: Kill assists
Post by: DorkeyDear on September 13, 2009, 03:30:10 pm
@Gizd - its the width of each character, something which really can't be measured using scripting core. Even if it could be, why bother re-measuring it every time you startup the script when it could be manually put in.
Title: Re: Kill assists
Post by: Serial K!ller on September 13, 2009, 03:31:55 pm
It's the DrawTextCenter (http://forums.soldat.pl/index.php?topic=17916.0) function I used and changed slightly.
Those numbers are the width of each character in the default font (Bank Gothic Lt BT) used to calculate the string width in pixels.

Tried to find a simpler way to define them like (TextWidth[32..126] = (value1,value2,...) but failed...

[edit]
Updated DrawTextCenter function so text doesn't overlap ctf/inf flagbox on long names.
Title: Re: Kill assists
Post by: F4||3N on September 13, 2009, 09:16:05 pm
Make it so if someone medikits. The assists get wiped! (If it isnt already)
Title: Re: Kill assists
Post by: Serial K!ller on September 14, 2009, 12:08:14 am
Make it so if someone medikits. The assists get wiped! (If it isnt already)
Already made it like that :)

Code: (pascal) [Select]

//In apponidle
//Polygon or medikit heal
if (((Getplayerstat(ID,'Health')*100)/healthfactor) > ((100-TotalPercentDamageRecieved(ID)))) then begin
RemoveDamageDoneBy(ID,((Getplayerstat(ID,'Health')*100)/healthfactor) - (100-TotalPercentDamageRecieved(ID)));
end;
Title: Re: Kill assists
Post by: crckdns on March 12, 2010, 01:59:12 pm
I am not sure, if it's a bug of assist script or a bug of regenerate script, I'm getting time to time such exceptions (and after that..even /recompile doesnt help, server is unuseable.
log:
Code: [Select]
(19:47:09) Sladalos has left the game.
(19:47:09)  [*] [Error] Regenerate -> (OnLeaveGame): Out of Global Vars range
(19:47:09)  [*] [Error] Regenerate -> (AppOnIdle): Access violation at address 080A0B43, accessing address 00000109
(19:47:09)  [*] [Error] z-KillAssists -> (AppOnIdle): Out of Global Vars range
(19:47:10)  [*] [Error] z-KillAssists -> (OnLeaveGame): Invalid Type
(19:47:10)  [*] [Error] Regenerate -> (AppOnIdle): Access violation at address 080A0BCC, accessing address 00000109
 [*] Exception raised on call to AppOnIdle (Access violation at address 080F5A3F, accessing address 00000004)
 [*] Exception raised on call to OnPlayerDamage (Access violation at address 080F5A3F, accessing address 00000004)
 [*] Exception raised on call to AppOnIdle (Access violation at address 080F5A3F, accessing address 00000004)
 [*] Exception raised on call to AppOnIdle (Access violation at address 080F5A3F, accessing address 00000004)
and so on and so on....

edit: ok, unloaded regenerate-script..and the bug with kill-assist is still there.. it appears without any signs what could cause it..
Title: Re: Kill assists
Post by: dnmr on March 12, 2010, 04:20:52 pm
could be because the script doesnt check for active right in the beginning of the loop in OnPlayerDeathGiveAssists. Try changing line 457 to

Code: (pascal) [Select]
if GetplayerStat(i,'Active') = true then if (Victim <> i) and (PlayersInfoArr[Victim].KilledBy <> i) and ((GetplayerStat(Victim,'Team') <> GetplayerStat(i,'Team')) or (GameStyle=0) or (GameStyle=1) or (GameStyle=4)) then begin(not tested)
Title: Re: Kill assists
Post by: crckdns on March 12, 2010, 05:38:43 pm
heh =) thanks for the reply^^
I'm not sure if this did help.. as I'm still getting time to time errors like
Code: [Select]
CornyNussig joining game (134.99.26.161:23073)
 [*] [Error] z-KillAssists -> (OnPlayerRespawn): Out of Global Vars range
[*] [Error] z-KillAssists -> (OnPlayerRespawn): Out of Global Vars range [*] [Error] z-KillAssists -> (AppOnIdle): Out of Global Vars range
Title: Re: Kill assists
Post by: dnmr on March 13, 2010, 03:50:23 am
bleh.. try to rename the vars in apponidle to something that's not used yet and make them global
Title: Re: Kill assists
Post by: Serial K!ller on March 13, 2010, 04:58:58 am
hmm... does it happen more when the regeneration script is also running?

That would call the RemoveDamageDoneBy() function in apponidle more which is a recurrent function and that might be the problem.

I'll see if I can rewrite the function so it does not have to call itself again.


Try setting line 282 "RemoveDamageDoneBy(ID,DamagePercentLeft);" in comment to check if that is causing the problem.

Code: (pascal) [Select]
if DamagePercentLeft <> 0 then begin
//RemoveDamageDoneBy(ID,DamagePercentLeft);
end;
Title: Re: Kill assists
Post by: Szewczuq on March 13, 2010, 07:01:28 am
too much TF2 in soldat, i dont like it :(
Title: Re: Kill assists
Post by: demoniac93 on March 13, 2010, 07:32:34 am
Keep this on the TBA servers ;/
Title: Re: Kill assists
Post by: Mexer on February 06, 2012, 09:25:54 am
Can you please reupload?
Title: Re: Kill assists
Post by: Falcon` on February 06, 2012, 02:04:27 pm
all the scripts that were on soldat central are still available here (http://enesce.com/static/sc_scripts/)
Title: Re: Kill assists
Post by: darDar on April 11, 2013, 07:16:26 pm
all the scripts that were on soldat central are still available here (http://enesce.com/static/sc_scripts/)
any other site?
Title: Re: Kill assists
Post by: Moroes on April 13, 2013, 11:41:53 am
all the scripts that were on soldat central are still available here (http://enesce.com/static/sc_scripts/)
any other site?
Try this
Code: [Select]
http://db.tt/FdPRgz29
Title: Re: Kill assists
Post by: rOy on April 15, 2013, 03:05:40 pm
Hey
Here this script.
Title: Re: Kill assists
Post by: Vos on April 16, 2013, 11:32:41 am
Thanks for the repost, nice script.
Title: Re: Kill assists
Post by: darDar on April 16, 2013, 02:09:06 pm
Thanks!