Difference between revisions of "TActivePlayer.OnVoteKick"

From Soldat Community Wiki
Jump to: navigation, search
m
m (Example)
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
==Description==
 
==Description==
Event property called when a player hits F11 or F12 during a kick vote.
+
Event property called when a player hits F12 during a kick vote. F11 (No) votes are ignored.
<br>  
+
<br>
  
 
==Example==
 
==Example==
Example makes players say "Voted!" when they hit F11/F12.
+
Example makes players say "Voted Yes!" when they hit F12.
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
 
procedure OnVoteMessage(Player, Victim: TActivePlayer);
 
procedure OnVoteMessage(Player, Victim: TActivePlayer);
 
begin
 
begin
   Player.Say('Voted!');
+
   Player.Say('Voted Yes!');
 
end;
 
end;
  

Latest revision as of 00:18, 26 September 2013

property OnVoteKick
 Access mode: RW
 Event handler type: TOnVoteKickEvent
 Event handler declaration: procedure (Player, Victim: TActivePlayer)

Description

Event property called when a player hits F12 during a kick vote. F11 (No) votes are ignored.

Example

Example makes players say "Voted Yes!" when they hit F12.

procedure OnVoteMessage(Player, Victim: TActivePlayer);
begin
  Player.Say('Voted Yes!');
end;

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