Author Topic: need help  (Read 471 times)

0 Members and 1 Guest are viewing this topic.

Offline Nubism

  • Major
  • *
  • Posts: 58
need help
« 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.
« Last Edit: October 26, 2008, 05:06:12 pm by Nubism »

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: need help
« Reply #1 on: October 27, 2008, 03:31:37 am »
Not tested, but it should work.

Code: [Select]
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;
...and headbutt the sucker through your banana suit!