Author Topic: Simple CTF Balancer  (Read 1867 times)

0 Members and 2 Guests are viewing this topic.

Offline deevus

  • Major(1)
  • Posts: 16
Simple CTF Balancer
« on: October 28, 2008, 01:57:16 am »
Script Name: Simple CTF Balancer
Script Version: 1.10
Script Description ctf, balancing, balancer
Author: deevus
Compile Test: Passed
Core Version: 2.6.3
Hosted by: Soldat Central - http://soldatcentral.com/

Balances CTF game mode by moving the last joined player from the opposite team.

Code: [Select]
procedure BalanceTeams(fromTeam, toTeam : byte);
var
i : integer;
Changed : boolean;
CmdStr : String;
begin
i := 1;
Changed := False;
while (i <= LAST_JOINED_LENGTH) and (not Changed) do begin
if arrLastJoined[i].Team = fromTeam then begin
CmdStr := '/setteam' + IntToStr(toTeam) + ' ' + IntToStr(arrLastJoined[i].ID);
Command(CmdStr);
SayToPlayer(arrLastJoined[i].ID, 'You have been moved to team ' + GetTeamName(toTeam));
arrLastJoined[i].ID := GetLastJoinedID(arrLastJoined[i].Team);
Changed := True;
end;
i := i + 1;
end;
end;

Quote from: Changelog
1.10

-- Added /balanceteams admin command to check balance
-- Added boolean constant to enable/disable auto checking of balance
-- Fixed bug where PlayerID wasn't defined if the last joined ID = 1

« Last Edit: October 30, 2008, 06:02:48 am by deevus »

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: Simple CTF Balancer
« Reply #1 on: October 28, 2008, 06:56:39 am »
Thanks Dude thats very usefull

Offline deevus

  • Major(1)
  • Posts: 16
Re: Simple CTF Balancer
« Reply #2 on: October 28, 2008, 06:06:43 pm »
No worries. :) Good to hear since its my first soldat script.

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: Simple CTF Balancer
« Reply #3 on: October 29, 2008, 03:37:12 am »
wut? first script ? Nice!

this is what i needed ^^

it suxs, always its 8 vs 6 or 5 vs 3

but this script ownz ^^

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: Simple CTF Balancer
« Reply #4 on: October 30, 2008, 03:03:27 am »
Great work - a very clean and effective balance script. Many thanks for making it!

Offline deevus

  • Major(1)
  • Posts: 16
Re: Simple CTF Balancer
« Reply #5 on: October 30, 2008, 06:03:52 am »
Updated to version 1.10
Check first post