class WeaponSource
Weapon › InventoryItemSuper
View all 110 descendants
- BinocularsBase
- UnderSlugLauncher
- Weapon_Base
script counterpart to engine's class Weapon
Methods 88
override bool IsWeapon()proto native void Synchronize()Force synchronizes the weapon state from Server to Client. Use with caution.
Show 1 more
, WeaponFSM.ValidateAndRepairHelper()proto native int GetMuzzleCount()Returns: number of muzzles
Show 33 more
, FirearmActionAttachMagazineQuick.ActionCondition(), Icon.CheckIsWeapon(), Icon.RefreshMuzzleIcon(), ItemActionsWidget.SetWeaponQuantity(), Magnum_Base.CanEjectBullet(), PlayerSpawnHandler.CreateChildItem(), SlotsIcon.CheckIsWeapon(), SlotsIcon.RefreshMuzzleIcon(), StepZeroingDownAllMuzzles(), StepZeroingUpAllMuzzles(), Weapon_Base.CopyWeaponStateFrom(), Weapon_Base.FillChamber(), Weapon_Base.FillInnerMagazine(), Weapon_Base.ForceSyncSelectionState(), Weapon_Base.GetMuzzleStates(), Weapon_Base.GetSlotsCountCorrect(), Weapon_Base.GetWeightSpecialized(), Weapon_Base.OnStoreLoad(), Weapon_Base.OnStoreSave(), WeaponChambering_MultiMuzzle.OnEntry(), WeaponChambering_MultiMuzzle.OnExit(), WeaponCylinderRotate.FindNextFreeMuzzle(), WeaponEjectAllMuzzles.OnEntry(), WeaponEjectBulletMultiMuzzle_Cartridge.OnEntry(), WeaponEjectCasingMultiMuzzle.OnEntry(), WeaponFireMultiMuzzle.OnEntry(), WeaponFSM.Internal_ValidateAndRepair(), WeaponGuardAnyChamberEmpty.GuardCondition(), WeaponGuardAnyChamberFiredOut.GuardCondition(), WeaponGuardChamberMultiHasRoomBulltet.GuardCondition(), WeaponGuardChamberMultiHasRoomBulltetIgnoreLast.GuardCondition(), WeaponManager.CanLoadBullet(), and WeaponManager.CanLoadMultipleBullet()conversion muzzleIndex -> slotId
- in
muzzleIndex - muzzle index
Returns: slotId on success, -1 otherwise
proto native int GetCurrentMuzzle()Returns: returns index of current muzzle
proto native void SetCurrentMuzzle(int muzzleIndex)sets index of active muzzle
- in
muzzleIndex
Show 9 more
, DoubleBarrelFireoutEmpty.OnEntry(), DoubleBarrelFireoutFireout.OnEntry(), DoubleBarrelFireoutLoaded.OnEntry(), DoubleBarrelLoadedEmpty.OnEntry(), DoubleBarrelLoadedLoaded.OnEntry(), Magnum_Base.InitStateMachine(), Weapon_Base.OnStoreLoad(), WeaponCylinderRotate.OnEntry(), and WeaponFireMultiMuzzle.OnEntry()proto native void SetNextMuzzleMode(int muzzleIndex)query whether the weapon can be fired or not
Returns: true if fire possible
ejects casing from chamber
ejects round from chamber
detects empty chamber
Returns: true if no cartridge in chamber
Show 19 more
, Magnum_Base.CanChamberBullet(), Pistol_Base.CanChamberBullet(), Weapon_Base.AfterStoreLoad(), Weapon_Base.CanFire(), Weapon_Base.CopyWeaponStateFrom(), Weapon_Base.FillSpecificChamber(), Weapon_Base.GetMuzzleStates(), Weapon_Base.GetWeightSpecialized(), Weapon_Base.RandomizeFSMState(), WeaponCylinderRotate.FindNextFreeMuzzle(), WeaponDetachingMag_StoreRemoveChamberBullet.OnEntry(), WeaponEjectAllMuzzles.OnEntry(), WeaponGuardAnyChamberEmpty.GuardCondition(), WeaponGuardChamberEmpty.GuardCondition(), WeaponGuardCurrentChamberEmpty.GuardCondition(), WeaponManager.CanEjectBulletVerified(), WeaponManager.EjectBulletVerified(), WeaponManager.Fire(), and WeaponUnjamming_Cartridge.OnEntry()detects presence of fired out casing in chamber
Returns: true if casing in chamber
Show 21 more
, Icon.RefreshMuzzleIcon(), ItemActionsWidget.SetWeaponQuantity(), Magnum_Base.CanChamberBullet(), Magnum_Base.ShowBullet(), SlotsIcon.RefreshMuzzleIcon(), Weapon_Base.CanChamberBullet(), Weapon_Base.CanFire(), Weapon_Base.GetMuzzleStates(), WeaponDetachingMag_StoreRemoveChamberBullet.OnEntry(), WeaponEjectAllMuzzles.OnEntry(), WeaponEjectCasing.OnEntry(), WeaponEjectCasingMultiMuzzle.OnEntry(), WeaponFSM.Internal_ValidateAndRepair(), WeaponGuardAnyChamberFiredOut.GuardCondition(), WeaponGuardChamberFiredOut.GuardCondition(), WeaponGuardCurrentChamberFiredOut.GuardCondition(), WeaponManager.CanEjectBulletVerified(), WeaponManager.CanLoadMultipleBullet(), WeaponManager.EjectBulletVerified(), WeaponManager.Fire(), and WeaponUnjamming_Cartridge.OnEntry()detects presence of damaged cartridge in chamber
Returns: true if jammed
detects presence of ejectable cartridge in muzzle's chamber
Returns: true if eject-able
maximum number of cartridges in chamber
Returns: true if full
Show 15 more
, Magnum_Base.CanEjectBullet(), Magnum_Static_State.HasBullet(), SlotsIcon.RefreshMuzzleIcon(), IsChamberFullEx(), Weapon_Base.CanChamberBullet(), Weapon_Base.ForceSyncSelectionState(), Weapon_Base.GetMuzzleStates(), WeaponChambering_Base.PushBulletFromChamberToInternalMagazine(), WeaponChambering_Base.PushBulletToChamber(), WeaponChambering_MultiMuzzle.OnEntry(), WeaponChambering_MultiMuzzle.OnExit(), WeaponFSM.Internal_ValidateAndRepair(), WeaponGuardChamberFull.GuardCondition(), WeaponGuardCurrentChamberFull.GuardCondition(), and WeaponGuardInnerMagazineFullShareChamber.GuardCondition()Returns: true if weapon has an internal magazine
Returns: returns number of available cartridges in chamber
Show 7 more
, Weapon_Base.CopyWeaponStateFrom(), Weapon_Base.EjectCartridge(), Weapon_Base.GetWeightSpecialized(), WeaponGuardChamberHasRoomForMoreThanOne.GuardCondition(), WeaponGuardHasAmmoInnerMagazine.GuardCondition(), WeaponGuardInternalMagazineHasRoomForBullet.GuardCondition(), and WeaponManager.CanLoadMultipleBullet()Returns: returns number of max cartridges in chamber
maximum number of cartridges in internal magazine
Returns: true if full
Returns: returns number of available cartridges in chamber + internal magazine
Returns: returns number of max cartridges in chamber + internal magazine
- in
Returns: returns the typename of a random ammo registered in 'chamberableFrom' in config
- in
Returns: returns name of i-th ammo type for chambering
get info about the cartridge in the chamber of a muzzle
- in
muzzleIndex - out
ammoDamage damageof the ammo- out
ammoTypeName typename of the ejected ammo
Returns: true if info retrieved
proto bool GetInternalMagazineCartridgeInfo(int muzzleIndex, int cartridgeIndex, out float ammoDamage, out string ammoTypeName)get info about the cartridge in the internal magazine of a muzzle
- in
muzzleIndex - in
cartridgeIndex - has to be 0 <= cartridgeIndex < GetInternalMagazineCartridgeCount()
- out
ammoDamage damageof the ammo- out
ammoTypeName typename of the ejected ammo
Returns: true if info retrieved
removes cartridge from chamber
push cartridge to chamber
push effect cartridge to Weapon
- in
muzzleIndex - in
ammoDamage damageof the ammo- in
ammoTypeName typename of the ammo
proto native void EffectBulletHide(int muzzleIndex)reset effect cartridge in weapon
- in
muzzleIndex
Show 13 more
, Weapon_Base.SyncSelectionState(), WeaponChambering_Base.HideBullet(), WeaponChambering_Start.OnEntry(), WeaponDetachingMag_StoreRemoveChamberBullet.OnAbort(), WeaponDetachingMag_StoreRemoveChamberBullet.OnEntry(), WeaponEjectAllMuzzles.OnEntry(), WeaponEjectBulletMultiMuzzle_Cartridge.OnEntry(), WeaponEjectCasing.OnEntry(), WeaponEjectCasingMultiMuzzle.OnEntry(), WeaponFireAndChamber.OnEntry(), WeaponFireAndChamberFromInnerMagazine.OnEntry(), WeaponFireWithEject.OnEntry(), and WeaponUnjamming_Cartridge.OnEntry()proto native void SetGroundAnimFrameIndex(int groundAnimFrameIndex)sets animation frame for ground state when animation is specified in config
Show 1 more
, WeaponStableState.SyncAnimState()proto bool PopCartridgeFromInternalMagazine(int muzzleIndex, out float ammoDamage, out string ammoTypeName)removes top-most cartridge from internal magazine
proto native bool PushCartridgeToInternalMagazine(int muzzleIndex, float ammoDamage, string ammoTypeName)push cartridge into internal magazine
query if a magazine can be attached to weapon
- in
muzzleIndex - in
mag - magazine to attach
Returns: true if magazine can be attached
proto native bool TestAttachMagazine(int muzzleIndex, Magazine mag, bool do_occupancy_test, bool do_script_check)query if a magazine can be attached to weapon
- in
muzzleIndex - in
mag - magazine to attach
- in
do_occupancy_test - if false, skips test for presence of another magazine in weapon
- in
do_script_check - if false, skips script conditions
Returns: true if magazine can be attached
perform attachment of a magazine to weapon
- in
muzzleIndex - in
mag - magazine to attach
Returns: true if magazine was attached
- in
muzzleIndex
Returns: attached magazine
Show 27 more
, FirearmActionAttachMagazineQuick.ActionCondition(), FirearmActionAttachMagazineQuick.Post_SetupAction(), FirearmActionBase.AddActionJuncture(), FirearmActionDetachMagazine.ActionCondition(), ItemActionsWidget.SetWeaponQuantity(), MiscGameplayFunctions.UnlimitedAmmoDebugCheck(), Pistol_Base.GetChanceToJam(), PlayerSpawnHandler.CreateChildItem(), PM73Rak_Base.GetChanceToJam(), RifleBoltFree_Base.GetChanceToJam(), RifleBoltLock_Base.GetChanceToJam(), Weapon_Base.AddJunctureToAttachedMagazine(), Weapon_Base.AfterStoreLoad(), Weapon_Base.ClearJunctureToAttachedMagazine(), Weapon_Base.ForceSyncSelectionState(), Weapon_Base.RandomizeFSMState(), WeaponFSM.Internal_ValidateAndRepair(), WeaponGuardCanDetachMag.GuardCondition(), WeaponGuardCanSwapMag.GuardCondition(), WeaponGuardHasAmmo.GuardCondition(), WeaponGuardHasMag.GuardCondition(), WeaponGuardMagazinesHaveEqualSizes.GuardCondition(), WeaponManager.CanSwapMagazine(), WeaponManager.OnInputUserDataProcess(), WeaponManager.PrepareInventoryLocationForMagazineSwap(), WeaponReplacingMagAndChamberNext.OnEntry(), and WeaponReplacingMagAndChamberNextOpenBoltCharged.OnEntry()defines time from one shot to another
- in
muzzleIndex
Returns: reload time in seconds
query if a bullet from magazine can be loaded into chamber
- in
muzzleIndex - in
mag - magazine to load from
Returns: true if cartidge from mag can be put into chamber
query the type of magazine the cartridge can be unloaded to
- in
muzzleIndex
Returns: entity type name
- in
Returns: returns the typename of a random magazine in 'magazines' in config
- in
Returns: returns the typename of the magazine in 'magazines' in config with highest capacity
- in
Returns: returns the number of magazines in 'magazines' in config
proto native bool EnterOptics()switches to optics mode if possible
Returns: true if success, false otherwise
proto native bool IsInOptics()is weapon in optics mode or not
Returns: true if in optics mode, false otherwise
proto native bool ExitOptics()switches out of optics mode (if possible)
Returns: true if success, false otherwise
proto native float GetZoom()returns current percentage of zoom
Returns: current percentage of zoom
sets current zoom (in %)
- in
percent zoomto set in range [0.0f .. 100.0f]
Returns: true if zoom set
proto native bool ZoomIn()moves current zoom by 1% up
Returns: true if zoom set
proto native bool ZoomOut()moves current zoom by 1% down
Returns: true if zoom set
proto native int GetStepZoom()returns position of currently used value in zoom config array
Returns: position of currently used value in zoom config array
sets zoom to fov value defined at given position in zoom fov config array
- in
index - of configured step, range [0..cfg_max]
Returns: true if zoom set
proto native bool StepZoomIn()sets zoom to next defined (respective to current) value in zoom fov config array
Returns: true if zoom set
proto native bool StepZoomOut()sets zoom to previous (respective to current) defined value in zoom fov config array
Returns: true if zoom set
returns position of currently used value in zeroing config array
Returns: position of currently used value in zeroing config array
sets zeroing to value defined at given position in zeroing config array
- in
index - of zeroing to set [0..cfg_max]
Returns: true if zeroing set
sets zeroing to next defined (respective to current) value in zeroing config array
Returns: true if zeroing set
sets zeroing to previous (respective to current) defined value in zeroing config array
Returns: true if zeroing set
returns currently used value of zeroing in config array of weapon or attached optics
Returns: currently used value in zeroing
returns maximum allowed discrete distance for the muzzle. Limits attached optics zeroing only! '0' if unclamped
Returns: maximum allowed discrete distance for the muzzle
proto native bool FlashlightOn()attempt to turn on flashlight
Returns: true if set on, false otherwise (no flashlight, no power, etc)
proto native bool FlashlightOff()attempt to turn off flashlight
Returns: true if on -> off, false otherwise (no flashlight, no power, etc, already off)
proto native bool IsFlashlightOn()query state of flashlight
Returns: true if set on
proto native UnderSlugLauncher GetAttachedLauncher()Returns: returns attached launcher or null
proto native ItemOptics GetAttachedOptics()Returns: returns attached optics or null
Show 17 more
, DayZPlayerCameraIronsights.SetupSightEntities(), DayZPlayerImplement.CameraHandler(), DayZPlayerImplement.ExitSights(), DayZPlayerImplement.HandleADS(), DayZPlayerImplement.HandleWeapons(), DayZPlayerImplement.OnDrawOptics2D(), Mosin9130_Base.CanEnterIronsights(), PP19_Base.CanEnterIronsights(), Saiga_Base.CanEnterIronsights(), SKS_Base.CanEnterIronsights(), SVD_Base.CanEnterIronsights(), Vikhr.CanEnterIronsights(), VSS.CanEnterIronsights(), Weapon_Base.CanEnterIronsights(), Weapon_Base.HideWeaponBarrel(), Weapon_Base.OnItemLocationChanged(), and WeaponDebug.GetEyePointPosition()proto native ItemSuppressor GetAttachedSuppressor()Returns: returns attached suppressor or null
gets camera position & direction in model space of weapon entity
Gets Zeroing distance at opticsZoomMin
Gets Zeroing distance at opticsZoomMax
proto native void SelectionBulletShow()proto native void SelectionBulletHide()Show 25 more
, ChamberFirst_InnerMagazine_SemiAutomatic_Base.InitStateMachine(), Crossbow_Base.InitStateMachine(), Flaregun.InitStateMachine(), LoopedChambering.OnEntry(), Magnum_Base.InitStateMachine(), Mp133Shotgun_Base.InitStateMachine(), OpenBolt_Base.InitStateMachine(), Pistol_Base.InitStateMachine(), Repeater_Base.InitStateMachine(), Rifle_Base.InitStateMachine(), RifleBoltFree_Base.InitStateMachine(), RifleBoltLock_Base.InitStateMachine(), RifleSingleShot_Base.InitStateMachine(), RifleSingleShotManual_Base.InitStateMachine(), SingleShotPistol_Base.InitStateMachine(), SKS_Base.InitStateMachine(), Weapon_Base.HideBullet(), Weapon_Base.SyncSelectionState(), WeaponChambering_Base.HideBullet(), WeaponChambering_MultiMuzzleMagnum.OnExit(), WeaponChambering_Start.OnEntry(), WeaponEjectCasing.OnEntry(), WeaponFireAndChamber.OnEntry(), WeaponFireAndChamberFromInnerMagazine.OnEntry(), and WeaponUnjamming_Cartridge.OnEntry()proto native void SelectionMagazineShow()proto native void SelectionMagazineHide()void StepZeroingUpAllMuzzles()void StepZeroingDownAllMuzzles()