TActivePlayer.OnVoteMapStart

From Soldat Community Wiki
Revision as of 13:53, 29 July 2013 by Mighty (talk | contribs) (Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
property OnVoteMapStart
 Access mode: RW
 Event handler type: TOnVoteMapStartEvent
 Event handler declaration: function(Player: TActivePlayer; Map: string): Boolean;

Description

Event property called when a player starts a map 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 map voted is ctf_Ash.

function DisableVoteAsh(Player: TActivePlayer; Map: string): Boolean;
begin
  Result := (Map = 'ctf_Ash');
end;

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