Author Topic: Extra points when killing  (Read 1483 times)

0 Members and 1 Guest are viewing this topic.

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Extra points when killing
« 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
Compile Test: Passed
Core Version: 2.6.3
Hosted by: Soldat Central - 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;



(Size 645 B)
- http://soldatcentral.com/index.php?page=script&f=82 -


** Script hosted by Soldat Central! Please visit the author's script page and Rate this script **

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Extra points when killing
« Reply #1 on: January 05, 2009, 03:33:46 pm »
I was there ^^
Congratulations on your first script!

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Extra points when killing
« Reply #2 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

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Extra points when killing
« Reply #3 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).

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Extra points when killing
« Reply #4 on: January 05, 2009, 09:24:16 pm »
Is that such a big problem?

Offline SpiltCoffee

  • Veteran
  • *****
  • Posts: 1579
  • Spilt, not Split!
    • SpiltCoffee's Site
Re: Extra points when killing
« Reply #5 on: January 06, 2009, 12:20:42 am »
It tends to be, yes.
When life hands you High Fructose Corn Syrup, Citric Acid, Ascorbic Acid, Maltodextrin, Sodium Acid Pyrophosphate,
Magnesium Oxide, Calcium Fumarate, Yellow 5, Tocopherol and Less Than 2% Natural Flavour... make Lemonade!