TActivePlayer.OnSpeak

From Soldat Community Wiki
Revision as of 07:38, 30 July 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
property OnSpeak
 Access mode: RW
 Event handler type: TOnSpeakEvent
 Event handler declaration: procedure(Player: TActivePlayer; Text: string)

Description

Event property called whenever a player sends a message. This does not include player commands.

Example

Example kicks a player if he wrote !kickme

procedure OnSpeakKickMe(Player: TActivePlayer; Text: string);
begin
  if Text = '!kickme' then
    Player.Kick;
end;

var 
  i: Byte;
begin
  for i:=1 to 32 do
    Players[i].OnSpeak := @OnSpeakKickMe;
end.