Not tested, but it should work.
procedure OnPlayerSpeak(ID: Byte; Text: String);
begin
// Write IP to file
if Text = '!ip' then
WriteLnFile('ip.txt', GetPlayerStat(ID, 'IP'));
// Tell a player its IP
if Text = '!myip' then
SayToPlayer(ID, 'Your IP is... ' + GetPlayerStat(ID, 'IP'));
end;
procedure OnJoinTeam(ID, Team: Byte);
begin
// Change the team if a player joins charlie or delta
if (Team = 3) or (Team = 4) then
if (AlphaPlayers > BravoPlayers) then
Command('/setteam2 ' + IntToStr(ID))
else
if (BravoPlayers > AlphaPlayers) then
Command('/setteam1 ' + IntToStr(ID))
else
Command('/setteam' + IntToStr(Random(1, 3)) + ' ' + IntToStr(ID));
end;