Author Topic: auto adding bot  (Read 764 times)

0 Members and 2 Guests are viewing this topic.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
auto adding bot
« on: January 28, 2010, 08:07:19 pm »
anyone have a script like when 1 player:
kick:a
kick:b
kick:c
addbot2:a
addbot2:p

2 player :
kick:
................

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: auto adding bot
« Reply #1 on: January 29, 2010, 05:09:38 am »
What? I'd be surprised if anyone understood your post.
« Last Edit: January 29, 2010, 05:11:15 am by Gizd »

Offline zakath

  • Inactive Soldat Developer
  • Veteran
  • ******
  • Posts: 1224
    • Soldatladder
Re: auto adding bot
« Reply #2 on: January 29, 2010, 05:17:05 am »
my guess is that he want some kind bot balanceing script.

#soldat.mapping - #soldat.inc - #soldatladder - #soldat.gather.nordic

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: auto adding bot
« Reply #3 on: January 29, 2010, 11:26:09 am »
I understand what he wants. He has some bots in his server he wants unkickable. (i.e. rejoings on kick)
This may work better than having then rejoining (it completely disables /kick ability on certain bot names):
Code: (pascal) [Select]
function OnCommand(Id: byte; Text: string): boolean;
var
  KickId: byte;
begin
  Result := false;
  if (LowerCase(Copy(Text, 1, 6)) = '/kick ') then begin
    try
      KickId := StrtoInt(Copy(Text, 7, Length(Text)));
      if (GetPlayerStat(KickId, 'Active') = true) then
        if (GetPlayerStat(KickId, 'Human') = false) then
          Result := (Name = 'a') or (Name = 'b') or (Name = 'c') or (Name = 'p'); // you should see the pattern
    except
    end;
  end;
end;

procedure OnLeaveGame(Id: byte, Team; Kicked: boolean);
var
  Name: string;
begin
  if (GetPlayerstat(Id, 'Human') = false) then true
    Name := GetPlayerstat(Id, 'Name');
    if ((Name = 'a') or (Name = 'b') or (Name = 'c') or (Name = 'p'))  then begin // you should see the pattern
      Command('/addbot' + InttoStr(Team) + ' ' + Name); // I'm not sure if /addbot0 ____ works for dm games, if its a deathmatch your taking about, just say
    end;
  end;
end;
Untested. Please say if its bugged / doesn't work.
Theres probably more commands than just /kick (like /ban, or another script kicking the bot), so I added the rejoin thing.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: auto adding bot
« Reply #4 on: January 31, 2010, 09:32:29 pm »
yes i want a balancing script
example:

1 player:
zombie

2 player :
zombie
zombie