Difference between revisions of "TActivePlayer.OnVoteMapStart"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
 
(Example)
 
Line 22: Line 22:
 
   for i:=1 to 32 do
 
   for i:=1 to 32 do
 
     Players[i].OnVoteMapStart := @DisableVoteAsh;
 
     Players[i].OnVoteMapStart := @DisableVoteAsh;
end;
+
end.
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:TActivePlayer]][[Category:Events]]
 
[[Category:TActivePlayer]][[Category:Events]]

Latest revision as of 13:53, 29 July 2013

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.