OnClientPedWeaponFire: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Fernando187 (talk | contribs) m (p) |
||
(One intermediate revision by one other user not shown) | |||
Line 10: | Line 10: | ||
*'''ammo''': an [[int]] ammount of ammo left for this weapon type. | *'''ammo''': an [[int]] ammount of ammo left for this weapon type. | ||
*'''ammoInClip''': an [[int]] ammount of ammo left for this weapon type in clip. | *'''ammoInClip''': an [[int]] ammount of ammo left for this weapon type in clip. | ||
*'''hitX''' | *'''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. | *'''hitElement''': an [[element]] which was hit by a shot. | ||
Line 27: | Line 29: | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== |
Latest revision as of 15:20, 1 June 2025
This event is called when ped shoots a weapon. This does not trigger for projectiles based, or melee weapons.
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
The source of this event is the ped who fired the weapon.
Example
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
Client ped events
- onClientPedDamage
- onClientPedHeliKilled
- onClientPedHitByWaterCannon
- onClientPedVehicleEnter
- onClientPedVehicleExit
- onClientPedWasted
- onClientPedWeaponFire
- onClientPedStep
- onClientPedChoke
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled