TTeam.OnJoin

From Soldat Community Wiki
Revision as of 13:24, 26 July 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
property OnJoin
 Access mode: RW
 Event handler type: TOnJoinTeamEvent
 Event handler declaration: procedure (Player: TPlayer; Team: TTeam);

Description

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

Example

 procedure MyOnJoinTeamHandler(Player: TActivePlayer; Team: TTeam);
 begin
   if Team.ID = 2 then
   begin
     Player.Team := 1;
     Player.Tell('Sorry, you can''t join Bravo Team');
   end;
 end;

 // ...

 begin
   // assign OnJoinTean handler
   Game.Team[1].OnJoin := @MyOnJoinTeamHandler;

   // ...

   // unassign
   Game.Team[1].OnJoin := nil;
 end;