Difference between revisions of "TActivePlayer.Alive"

From Soldat Community Wiki
Jump to: navigation, search
m (Example)
Line 8: Line 8:
 
  var i: byte;
 
  var i: byte;
 
  begin
 
  begin
   for i := 1 to 32 do if Players[i].Alive then
+
   for i := 1 to 32 do begin
  Players[i].Damage(i,4000); //kills all alive players
+
    if Players[i].Alive then
 +
      Players[i].Alive := False // causes player to die
 +
    else
 +
      Players[i].Alive := True; // causes player to respawn
 +
  end;
 
  end;
 
  end;
 
</syntaxhighlight>
 
</syntaxhighlight>
 
[[Category:TActivePlayer]]
 
[[Category:TActivePlayer]]

Revision as of 21:04, 26 June 2013

property TActivePlayer.Alive: Boolean
 Access mode: RW

Description

Wether a player is alive or not.

Example

 var i: byte;
 begin
  for i := 1 to 32 do begin
    if Players[i].Alive then
      Players[i].Alive := False // causes player to die
    else
      Players[i].Alive := True; // causes player to respawn
   end;
 end;