TGame.OnLeave

From Soldat Community Wiki
Revision as of 11:04, 10 September 2016 by Mighty (talk | contribs) (Description)
Jump to: navigation, search
property OnLeave
 Access mode: RW
 Event handler type: TOnLeaveGameEvent
 Event handler declaration: procedure (Player: TActivePlayer; Kicked: Boolean);

Description

Event property called when any player leaves the server or gets kicked/banned.

Note: something

Example

 procedure MyOnLeaveHandler(Player: TActivePlayer; Kicked: Boolean);
 begin
   if Kicked then
     WriteLn(Player.Name + ' has been kicked!')
   else
     WriteLn(Player.Name + ' has left the game in peace');
 end;

 // ...

 begin
   // assign OnLeave handler
   Game.OnLeave := @MyOnLeaveHandler;

   // ...

   // unassign
   Game.OnLeave := nil;
 end;