Official Soldat Forums
Server Talk => Scripting Releases => Topic started 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:
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)
-
Here's a heads up; instead of having separate variables for the string and the integer, use inttostr(need) instead.
-
UPDATE :) Thanks for advice. I forgot about it :)
-
umm... won't this have one kill counter for all players?
-
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))
-
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 ;)