Author Topic: [update] Bonus points 1.1  (Read 2192 times)

0 Members and 2 Guests are viewing this topic.

Offline N3T

  • Major(1)
  • Posts: 7
  • N3T
[update] Bonus points 1.1
« on: June 07, 2008, 04:33:52 am »
Script Name: Bonus points
Script Description: You will get bonus points if number of kills (kills of all players without suicides) will be equal needed kills xD
Original Author(s): N3T
Core Version: 2.6.3
Code:
Code: [Select]
var
x: byte;
need: byte;
points: byte;


procedure ActivateServer();
begin
points := 2; //Number of xtra points
need := 10; //Number of kills need to get xtra points

end;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin

if (Killer <> Victim) then
begin

x := x + 1;

if (x = need) then
begin
SetScore(Killer,GetPlayerStat(Killer,'KILLS') + points);
x := 0;
WriteConsole(0,inttostr(need)+' kill! Extra '+inttostr(points)+' point(s) for '+IDtoName(Killer)+'.',$EE81FAA1);
end;
end;
end;

procedure OnMapChange(NewMap: String);
begin
x := 0;
end;

Download:

Rapidshare.com
« Last Edit: June 07, 2008, 10:32:22 am by N3T »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: Bonus points
« Reply #1 on: June 07, 2008, 07:43:30 am »
Here's a heads up; instead of having separate variables for the string and the integer, use inttostr(need) instead.

Offline N3T

  • Major(1)
  • Posts: 7
  • N3T
Re: [update] Bonus points 1.1
« Reply #2 on: June 07, 2008, 10:35:49 am »
UPDATE :) Thanks for advice. I forgot about it :)

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: [update] Bonus points 1.1
« Reply #3 on: June 07, 2008, 01:21:00 pm »
umm... won't this have one kill counter for all players?

Offline amb2010

  • Camper
  • ***
  • Posts: 264
  • Fear the dot ...
Re: [update] Bonus points 1.1
« Reply #4 on: June 07, 2008, 03:09:49 pm »
Yeah it will... Use an array for x so that each player can have their own counter(in case you don't know how to do them: Click)
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".

Offline N3T

  • Major(1)
  • Posts: 7
  • N3T
Re: [update] Bonus points 1.1
« Reply #5 on: June 10, 2008, 12:34:41 pm »
Yeah it will... Use an array for x so that each player can have their own counter(in case you don't know how to do them: Click)
And...
umm... won't this have one kill counter for all players?


No, it won`t. This script is 4 fun :) May I will add "WriteConsole" to information players, when is one kill before bonus kill :) I think that, you will understand me ;)