Difference between revisions of "TActivePlayer.WeaponActive"

From Soldat Community Wiki
Jump to: navigation, search
m (Example)
(Example: Old example assumed the knife was activated beforehand)
Line 9: Line 9:
 
var i: byte;
 
var i: byte;
 
begin
 
begin
   for i := 1 to 14 do (if i <> 12) then
+
   for i := 1 to 14 do
     Players[i].WeaponActive[i] := False; //deactivate all weapons but knife
+
     Players[i].WeaponActive[i] := i = 12; //deactivate all weapons but knife
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:TActivePlayer]]
 
[[Category:TActivePlayer]]

Revision as of 14:36, 29 July 2013

property TActivePlayer.WeaponActive[ID: Byte]: Boolean
 Access mode: W

Description

Sets a weapon available/unavailable from the weapon menu for a certain player.
Weapon ID goes from 1 to 14 (Desert Eagles, HK .... Chainsaw, Law).

Example

var i: byte;
begin
  for i := 1 to 14 do
    Players[i].WeaponActive[i] := i = 12; //deactivate all weapons but knife