Difference between revisions of "TActivePlayer.Ban"

From Soldat Community Wiki
Jump to: navigation, search
(Created page with " '''''function Ban(Time: Integer; Reason: string): Boolean''''' Time: period in minutes for the player to be banned Reason: ban reason Result: if it worked or not. ==Des...")
 
 
Line 6: Line 6:
 
Bans a player for a certain period.<br>
 
Bans a player for a certain period.<br>
 
Results false if you attempt to ban an inactive ID or an admin; true otherwise.
 
Results false if you attempt to ban an inactive ID or an admin; true otherwise.
 +
 +
==Example==
 +
<syntaxhighlight lang="pascal">
 +
var i: byte;
 +
begin
 +
  for i := 1 to 32 do if Players[i].Active then
 +
    Players[i].Ban(5,'Get out!'); //bans all active players for 5 minutes
 +
end;
 +
</syntaxhighlight>
  
 
[[Category:TActivePlayer]]
 
[[Category:TActivePlayer]]

Latest revision as of 16:50, 1 July 2013

function Ban(Time: Integer; Reason: string): Boolean
 Time: period in minutes for the player to be banned
 Reason: ban reason
 Result: if it worked or not.

Description

Bans a player for a certain period.
Results false if you attempt to ban an inactive ID or an admin; true otherwise.

Example

var i: byte;
begin
  for i := 1 to 32 do if Players[i].Active then
    Players[i].Ban(5,'Get out!'); //bans all active players for 5 minutes
end;