Difference between revisions of "TActivePlayer.Alive"

From Soldat Community Wiki
Jump to: navigation, search
(Created page with " '''''property TActivePlayer.Alive: Boolean''''' Acess mode: RW ==Description== Wether a player is alive or not. ==Example== <syntaxhighlight lang="pascal"> var i: byte; ...")
 
(Example: Capitalized `Btye` for consistency. Condensed code making it easier to understand)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
  '''''property TActivePlayer.Alive: Boolean'''''
 
  '''''property TActivePlayer.Alive: Boolean'''''
   Acess mode: RW
+
   Access mode: RW
 
==Description==
 
==Description==
Wether a player is alive or not.
+
If a player is alive or not.
  
 
==Example==
 
==Example==
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
  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
  Players[i].Damage(i,4000); //kills all alive players
+
    Players[i].Alive := not Players[i].Alive; // causes player to die if alive, and respawn if dead
 
  end;
 
  end;
 
</syntaxhighlight>
 
</syntaxhighlight>
 
[[Category:TActivePlayer]]
 
[[Category:TActivePlayer]]

Latest revision as of 15:54, 29 July 2013

property TActivePlayer.Alive: Boolean
 Access mode: RW

Description

If a player is alive or not.

Example

 var i: Byte;
 begin
  for i := 1 to 32 do
    Players[i].Alive := not Players[i].Alive; // causes player to die if alive, and respawn if dead
 end;