Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: N3T on June 07, 2008, 04:33:52 am

Title: [update] Bonus points 1.1
Post by: N3T 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 (http://rapidshare.com/files/120771056/Bonus_points.zip)
Title: Re: Bonus points
Post by: Toumaz 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.
Title: Re: [update] Bonus points 1.1
Post by: N3T on June 07, 2008, 10:35:49 am
UPDATE :) Thanks for advice. I forgot about it :)
Title: Re: [update] Bonus points 1.1
Post by: danmer on June 07, 2008, 01:21:00 pm
umm... won't this have one kill counter for all players?
Title: Re: [update] Bonus points 1.1
Post by: amb2010 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 (http://www.learn-programming.za.net/programming_pascal_learn07.html))
Title: Re: [update] Bonus points 1.1
Post by: N3T 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 (http://www.learn-programming.za.net/programming_pascal_learn07.html))
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 ;)