SetWeaponActive

From Soldat Community Wiki
Jump to: navigation, search

From the Scripting Manual

procedure SetWeaponActive(ID, WeaponNum: byte; State: boolean);

Parameter Info:
 ID (Byte): Player ID to change weapon visibility. Set to 0 for all players!
 WeaponNum (Byte): Weapon Number to set visible/invisible in the weapon menu.
 State (Boolean): Set true=visible or false=invisible. Default: true.

Description:
 This function will set wether or not a weapon is visible to be selected, in the ingame weapon menu   for a specific player. Set ID to 0 to send to all players.

Examples

begin
  SetWeaponActive(1,2,false); // Player 1 will now be unable to choose the HK MP5 from the weapon menu.
end;

Notes

  • All weapons are being enabled each time a player joins any team, so if you do something like that (example below), the Player will have all weapons enabled
begin
  SetWeaponActive(1,2,false);
  Command('/setteam2 1');
end;

External Links