Author Topic: Auto kick - help  (Read 840 times)

0 Members and 1 Guest are viewing this topic.

Offline Ut0ks

  • Major(1)
  • Posts: 2
Auto kick - help
« on: June 03, 2013, 06:05:30 am »
I need a person who may edit this script:

Code: [Select]
//1v1 script by P

procedure OnJoinTeam(ID, Team: byte);
begin
if Team <> 5 then
begin
if DeathmatchPlayers > 2 then
Command('/setteam5 '+IntToStr(ID));
if Team <> 0 then
Command('/setteam5 '+IntToStr(ID));
end;
end;

procedure OnPlayerSpeak(ID: byte; Text: string);
begin
case LowerCase(Text) of
'!j':
if GetPlayerStat(ID, 'Team') <> 0 then
begin
if DeathmatchPlayers >= 2 then
begin
WriteConsole(ID, 'The game is currently full.', $FF33FFCC);
end else
Command('/setteam0 '+IntToStr(ID));
end else
WriteConsole(ID, 'You are already ingame.', $FF33FFCC);
'!s':
if GetPlayerStat(ID, 'Team') <> 5 then
begin
Command('/setteam5 '+IntToStr(ID));
end else
WriteConsole(ID, 'You are already spectating.', $FF33FFCC);
'!help':
WriteConsole(ID,'!j   !s' , $FF33FFCC);
end;
end;


The idea is that the person who is trying to join the game (If the server they play two people) was kicked from the server automatically.

Would anyone be able to modify the script in such a way? I would be very greatful.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Auto kick - help
« Reply #1 on: June 03, 2013, 06:32:01 am »
Can't you just set max players to two in soldat.ini?
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

DarkCrusade

  • Guest
Re: Auto kick - help
« Reply #2 on: June 03, 2013, 07:28:16 am »
He wants players to be able to spectate I guess.

Code: [Select]
//1v1 script by P

procedure OnJoinTeam(ID, Team: byte);
begin
 if Team <> 5 then
 begin
  if DeathmatchPlayers > 2 then
  Command('/kick '+IntToStr(ID));
  if Team <> 0 then
  Command('/kick '+IntToStr(ID));
 end;
end;

procedure OnPlayerSpeak(ID: byte; Text: string);
begin
 case LowerCase(Text) of
  '!j':
   if GetPlayerStat(ID, 'Team') <> 0 then
   begin
    if DeathmatchPlayers >= 2 then
    begin
     WriteConsole(ID, 'The game is currently full.', $FF33FFCC);
    end else
    Command('/setteam0 '+IntToStr(ID));
   end else
   WriteConsole(ID, 'You are already ingame.', $FF33FFCC);
  '!s':
   if GetPlayerStat(ID, 'Team') <> 5 then
   begin
    Command('/setteam5 '+IntToStr(ID));
   end else
   WriteConsole(ID, 'You are already spectating.', $FF33FFCC);
  '!help':
  WriteConsole(ID,'!j   !s' , $FF33FFCC);
 end;
end;
« Last Edit: June 03, 2013, 08:15:03 am by DarkCrusade »

Offline Ut0ks

  • Major(1)
  • Posts: 2
Re: Auto kick - help
« Reply #3 on: June 04, 2013, 02:23:23 am »
He wants players to be able to spectate I guess.

Code: [Select]
//1v1 script by P

procedure OnJoinTeam(ID, Team: byte);
begin
 if Team <> 5 then
 begin
  if DeathmatchPlayers > 2 then
  Command('/kick '+IntToStr(ID));
  if Team <> 0 then
  Command('/kick '+IntToStr(ID));
 end;
end;

procedure OnPlayerSpeak(ID: byte; Text: string);
begin
 case LowerCase(Text) of
  '!j':
   if GetPlayerStat(ID, 'Team') <> 0 then
   begin
    if DeathmatchPlayers >= 2 then
    begin
     WriteConsole(ID, 'The game is currently full.', $FF33FFCC);
    end else
    Command('/setteam0 '+IntToStr(ID));
   end else
   WriteConsole(ID, 'You are already ingame.', $FF33FFCC);
  '!s':
   if GetPlayerStat(ID, 'Team') <> 5 then
   begin
    Command('/setteam5 '+IntToStr(ID));
   end else
   WriteConsole(ID, 'You are already spectating.', $FF33FFCC);
  '!help':
  WriteConsole(ID,'!j   !s' , $FF33FFCC);
 end;
end;

Thanks!