TActivePlayer.OnSpeak

From Soldat Community Wiki
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.