Difference between revisions of "TActivePlayer.WeaponActive"

From Soldat Community Wiki
Jump to: navigation, search
(Description)
 
(6 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
   Access mode: W
 
   Access mode: W
 
==Description==
 
==Description==
Sets a weapon in the player menu available/unavailable.<br>
+
Sets a weapon available/unavailable from the weapon menu for a certain player.<br>
 
Weapon ID goes from 1 to 14 (Desert Eagles, HK .... Chainsaw, Law).
 
Weapon ID goes from 1 to 14 (Desert Eagles, HK .... Chainsaw, Law).
  
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[1].WeaponActive[i] := True; //deactivate all weapons but knife
+
     Players[ID].WeaponActive[i] := i = 12; // deactivate all weapons but knife
 +
end;
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:TActivePlayer]]
 
[[Category:TActivePlayer]]

Latest revision as of 14:12, 24 February 2016

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[ID].WeaponActive[i] := i = 12; // deactivate all weapons but knife
end;