onClientPedWeaponFire
Client-side
 Server-side
 Shared
 This event is called when ped shoots a weapon. This does not trigger for projectiles based, or melee weapons.
       Note      
 This event is only triggered for peds that are streamed in
Parameters
int weapon, int ammo, int ammoInClip, float hitX, float hitY, float hitZ, element hitElement- weapon: an int representing weapon used for making a shot.
- ammo: an int ammount of ammo left for this weapon type.
- ammoInClip: an int ammount of ammo left for this weapon type in clip.
- hitX: float world X coordinate representing the hit point.
- hitY: float world Y coordinate representing the hit point.
- hitZ: float world Z coordinate representing the hit point.
- hitElement: an element which was hit by a shot.
Source
element: The source of this event is the ped who fired the weapon.
Code Examples
 client   
 addEventHandler("onClientPedWeaponFire", root,     function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)          if isElement(hitElement) and getElementType(hitElement) == "player" then               outputChatBox("You hit " .. getPlayerName(hitElement), 0, 255, 0)          end     end)See Also
Ped Events
Ped Functions
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedReloadingWeapon
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle
- IsPedFootBloodEnabled
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetStart
- getPedTargetEnd
- getPedTargetCollision
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- isPedBleeding
- givePedWeapon
- isPedDoingTask
- isPedTargetingMarkerEnabled
- playPedVoiceLine
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- getPedGravity
- reloadPedWeapon
- setPedChoking
- setPedGravity
- setPedWearingJetpack
 
 