Show / Hide Table of Contents

Class CustomWeapon

Represents a custom weapon that can be placed in the world

Inheritance
Object
Element
PhysicalElement
CustomWeapon
Inherited Members
PhysicalElement.Dimension
PhysicalElement.Interior
PhysicalElement.Frozen
PhysicalElement.Alpha
PhysicalElement.Health
PhysicalElement.Model
PhysicalElement.CollisionShape
PhysicalElement.CollisionsEnabled
PhysicalElement.LowLODElement
PhysicalElement.DoubleSided
PhysicalElement.IsInWater
PhysicalElement.IsLowLOD
PhysicalElement.Position
PhysicalElement.Rotation
PhysicalElement.QuaternionRotation
PhysicalElement.Matrix
PhysicalElement.ForwardVector
PhysicalElement.RightVector
PhysicalElement.UpVector
PhysicalElement.Velocity
PhysicalElement.AngularVelocity
PhysicalElement.AngularQuaternionVelocity
PhysicalElement.ToAttached
PhysicalElement.IsAttached
PhysicalElement.IsWithinCollisionShape(CollisionShape)
PhysicalElement.IsWithinMarker(SharedMarker)
PhysicalElement.AttachTo(PhysicalElement, Matrix4x4)
PhysicalElement.AttachTo(PhysicalElement, Vector3, Vector3)
PhysicalElement.AttachTo(PhysicalElement, Vector3, Quaternion)
PhysicalElement.AttachTo(PhysicalElement)
PhysicalElement.Detach()
PhysicalElement.Offset
PhysicalElement.GetWithinRange(Vector3, Single, String)
PhysicalElement.FaceElement(PhysicalElement)
PhysicalElement.OnClicked
PhysicalElement.OnModelChange
PhysicalElement.OnStartSync
PhysicalElement.OnStopSync
PhysicalElement.OnStreamIn
PhysicalElement.OnStreamOut
Element.element
Element.Root
Element.MTAElement
Element.Type
Element.ID
Element.Exists
Element.ChildCount
Element.Parent
Element.CallPropagationEnabled
Element.SetData(String, Object, Boolean)
Element.GetData(String, Boolean)
Element.TryGetData(String, Object, Boolean)
Element.GetData<T>(String, Boolean)
Element.TryGetData<T>(String, T, Boolean)
Element.Destroy()
Element.GetChild(Int32)
Element.GetChildren(String)
Element.GetByID(String, Int32)
Element.ListenForEvent(String, Boolean, String)
Element.HandleEvent(String, MtaElement, Object, Object, Object, Object, Object, Object, Object, Object)
Element.OnDestroy
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Slipe.Client.Weapons
Assembly: SlipeClient.dll
Syntax
[DefaultElementClass(ElementType.Weapon)]
public class CustomWeapon : PhysicalElement

Constructors

| Improve this Doc View Source

CustomWeapon(SharedWeaponModel, Vector3)

Create a custom weapon at a certain position

Declaration
public CustomWeapon(SharedWeaponModel model, Vector3 position)
Parameters
Type Name Description
SharedWeaponModel model
Vector3 position

Properties

| Improve this Doc View Source

Ammo

Get and set the ammo of this weapon

Declaration
public int Ammo { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

AmmoInClip

Get and set the ammo currently in the clip

Declaration
public int AmmoInClip { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

FiringRate

Set the firing rate of this weapon

Declaration
public int FiringRate { get; set; }
Property Value
Type Description
Int32
| Improve this Doc View Source

State

Get and set the state of this weapon

Declaration
public WeaponState State { get; set; }
Property Value
Type Description
WeaponState

Methods

| Improve this Doc View Source

Fire()

Fire the weapon!

Declaration
public bool Fire()
Returns
Type Description
Boolean
| Improve this Doc View Source

ResetFiringRate()

Reset the firing rate of this weapon

Declaration
public bool ResetFiringRate()
Returns
Type Description
Boolean
| Improve this Doc View Source

SetTarget()

Have the weapon target along its rotation

Declaration
public bool SetTarget()
Returns
Type Description
Boolean
| Improve this Doc View Source

SetTarget(Ped, Bone)

Have the weapon target a ped at a specific bone

Declaration
public bool SetTarget(Ped ped, Bone bone)
Parameters
Type Name Description
Ped ped
Bone bone
Returns
Type Description
Boolean
| Improve this Doc View Source

SetTarget(BaseVehicle, Tire)

Have the weapon target a vehicle tire

Declaration
public bool SetTarget(BaseVehicle vehicle, Tire tire)
Parameters
Type Name Description
BaseVehicle vehicle
Tire tire
Returns
Type Description
Boolean
| Improve this Doc View Source

SetTarget(PhysicalElement)

Have the weapon target the center of any element (vehicle, ped, player, world object)

Declaration
public bool SetTarget(PhysicalElement physicalElement)
Parameters
Type Name Description
PhysicalElement physicalElement
Returns
Type Description
Boolean
| Improve this Doc View Source

SetTarget(Vector3)

Have the weapon target a position

Declaration
public bool SetTarget(Vector3 position)
Parameters
Type Name Description
Vector3 position
Returns
Type Description
Boolean

Events

| Improve this Doc View Source

OnFire

Declaration
public event CustomWeapon.OnFireHandler OnFire
Event Type
Type Description
CustomWeapon.OnFireHandler

Extension Methods

ElementExtensions.GetBoundingBox(PhysicalElement)
ElementExtensions.GetDistanceFromCentreOfMassToBaseOfModel(PhysicalElement)
ElementExtensions.GetRadius(PhysicalElement)
ElementExtensions.SetCollidableWith(PhysicalElement, PhysicalElement, Boolean)
ElementExtensions.IsCollidableWith(PhysicalElement, PhysicalElement)
ElementExtensions.IsLocal(PhysicalElement)
ElementExtensions.IsOnScreen(PhysicalElement)
ElementExtensions.SetStreamable(PhysicalElement, Boolean)
ElementExtensions.IsStreamable(PhysicalElement)
ElementExtensions.IsStreamedIn(PhysicalElement)
ElementExtensions.IsSyncer(PhysicalElement)
ElementExtensions.IsWaitingForGroundToLoad(PhysicalElement)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX