TActivePlayer.OnVoteKickStart

From Soldat Community Wiki
Revision as of 08:17, 30 July 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
property OnVoteKickStart
 Access mode: RW
 Event handler type: TOnVoteKickStartEvent
 Event handler declaration: function(Player, Victim: TActivePlayer; Reason: string): Boolean;

Description

Event property called when a player starts a kick vote.
If the result is set to TRUE, vote will not be started. It's up to the script to inform player why the vote didn't work then.

Example

Example ignores the vote attempt if vote reason is shorter than 4 characters.

function DisableVoteWithNoReason(Player, Victim: TActivePlayer; Reason: string): Boolean;
begin
  Result := (Length(Reason) < 4);
end;

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