Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: Nubism on October 26, 2008, 04:27:08 pm
-
i need 3 simple scripts please
1. if one player writes !ip then it should list his ip on a file called ip.txt.
2. if anyone type !myip then it should show him his ip with "/pm id your ip is ..."
3. i need a script for my teammatch server, that the guys who try to join delta or charlie get changed to alpha or bravo, the team with less players or to any of this teams if they are balanced or there are 0 players in the server.
anyone asked for a script like this but no one answered him yet, so i will ask for it here again and use it then too ;)
i hope that anyone can help.
-
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;