Difference between revisions of "TTeam.OnJoin"
(new page) |
m (→Example) |
||
Line 23: | Line 23: | ||
begin | begin | ||
// assign OnJoinTean handler | // assign OnJoinTean handler | ||
− | Game. | + | Game.Teams[1].OnJoin := @MyOnJoinTeamHandler; |
// ... | // ... | ||
// unassign | // unassign | ||
− | Game. | + | Game.Teams[1].OnJoin := nil; |
end; | end; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:TTeam]][[Category:Events]] | [[Category:TTeam]][[Category:Events]] |
Revision as of 13:28, 26 July 2013
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.Teams[1].OnJoin := @MyOnJoinTeamHandler;
// ...
// unassign
Game.Teams[1].OnJoin := nil;
end;