Difference between revisions of "TActivePlayer.Kick"

From Soldat Community Wiki
Jump to: navigation, search
(Created page with " '''''function Kick: Boolean''''' Result: if it worked ==Description== Kicks a player from the server.<br> Results false if you attempt to kick an inactive ID; otherwise tru...")
 
(Added reason parameter)
 
Line 1: Line 1:
  '''''function Kick: Boolean'''''
+
  '''''function Kick: Boolean(Reason: TKickReason)'''''
 
   Result: if it worked
 
   Result: if it worked
 +
  Reason: Enum (TKickNoResponse, TKickNoCheatResponse,
 +
  TKickChangeTeam, TKickPing, TKickFlooding, TKickConsole,
 +
    TKickConnectionCheat, TKickCheat, TKickLeft, TKickVoted,
 +
    TKickAC, TKickSilent);
 
==Description==
 
==Description==
 
Kicks a player from the server.<br>
 
Kicks a player from the server.<br>
Line 10: Line 14:
 
begin
 
begin
 
   for i := 1 to 32 do if Players[i].Active then
 
   for i := 1 to 32 do if Players[i].Active then
     Players[i].Kick; //kicks all active players
+
     Players[i].Kick(TKickConsole); //kicks all active players
 
end;
 
end;
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:TActivePlayer]]
 
[[Category:TActivePlayer]]

Latest revision as of 20:48, 23 June 2016

function Kick: Boolean(Reason: TKickReason)
 Result: if it worked
 Reason: Enum (TKickNoResponse, TKickNoCheatResponse,
 	TKickChangeTeam, TKickPing, TKickFlooding, TKickConsole,
   TKickConnectionCheat, TKickCheat, TKickLeft, TKickVoted,
   TKickAC, TKickSilent);

Description

Kicks a player from the server.
Results false if you attempt to kick an inactive ID; otherwise true.

Example

var i: byte;
begin
  for i := 1 to 32 do if Players[i].Active then
    Players[i].Kick(TKickConsole); //kicks all active players
end;