Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: ~Niko~ on January 05, 2009, 10:38:56 am

Title: Extra points when killing
Post by: ~Niko~ on January 05, 2009, 10:38:56 am
Second script. It's gettin' better :)
Thanks again to everyone who helped me on IRC. :D

Script Name: Extra points when kill
Script Description Extra points when kill
Author: Niko (http://soldatcentral.com/index.php?page=profile&u=104)
Compile Test: (http://soldatcentral.com/images/pass.gif) Passed
Core Version: 2.6.3
Hosted by: Soldat Central - http://soldatcentral.com/ (http://soldatcentral.com/)

Full Description:
This script gives an an amount of extra points each time you kill someone after kill an established number of enemies without dying. Better for DM/CTF.

Code: [Select]
var
  killcount: array[1..32] of integer;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
  killcount[victim] := 0;
  killcount[killer] := killcount[killer] + 1;
  //1 is the amount of points a player will earn each kill since he killed "x" enemies.
  if killcount[killer] >= 3 then
  //3 is the number of kills needed to start earning points.
  //If you set it to 3, the killer will start to gain an extra point each kill since he killed his third enemy.
begin
    WriteConsole(Killer,'[*]You got an extra point!',$EE81FAA1);
    SetScore(killer,GetPlayerStat(killer,'KILLS') + 1);
end;
end;


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


** Script hosted by Soldat Central (http://soldatcentral.com/index.php?page=script&f=82)! Please visit the author's script page (http://soldatcentral.com/index.php?page=script&f=82) and Rate this script **
Title: Re: Extra points when killing
Post by: DorkeyDear on January 05, 2009, 03:33:46 pm
I was there ^^
Congratulations on your first script!
Title: Re: Extra points when killing
Post by: ~Niko~ on January 05, 2009, 03:53:43 pm
Second, though the first was so sad that this can be considered my first (decent) script xDD
Title: Re: Extra points when killing
Post by: danmer on January 05, 2009, 07:58:50 pm
you really want to reset the killcount when the player joins the game too (in OnJoinTeam). Since he could end up getting bonus from a player that already left if he gets the same ID (cause you only reset killcount on death).
Title: Re: Extra points when killing
Post by: ~Niko~ on January 05, 2009, 09:24:16 pm
Is that such a big problem?
Title: Re: Extra points when killing
Post by: SpiltCoffee on January 06, 2009, 12:20:42 am
It tends to be, yes.