SetWeaponActive

From Soldat Community Wiki
Revision as of 10:15, 15 August 2012 by Freeman (talk | contribs) (Created page with "===From the Scripting Manual=== ''procedure SetWeaponActive(ID, WeaponNum: byte; State: boolean);'' '''Parameter Info:''' ID (Byte): Player ID to change weapon visibilit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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): Ammo to give the player. 0 for default.

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