OnPedWeaponSwitch: Difference between revisions
Jump to navigation
Jump to search
(Added.) |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''previousWeaponID''': | *'''previousWeaponID''': an [[int]] representing the [[weapon]] that was switched from. | ||
*'''currentWeaponID''': | *'''currentWeaponID''': an [[int]] representing the [[weapon]] that was switched to. | ||
==Source== | ==Source== | ||
Line 26: | Line 26: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event| | {{See also/Server event|Ped events}} |
Latest revision as of 03:04, 27 September 2018
This event is triggered when a ped switches weapons.
Parameters
int previousWeaponID, int currentWeaponID
- previousWeaponID: an int representing the weapon that was switched from.
- currentWeaponID: an int representing the weapon that was switched to.
Source
The source of this event is the ped that switched his weapon.
Example
This example outputs a line to the chat box whenever a ped changes weapons.
function weaponSwitch ( previousWeaponID, currentWeaponID ) outputChatBox("A ped switched weapons from " .. previousWeaponID .. " to " .. currentWeaponID .. "!") end addEventHandler ( "onPedWeaponSwitch", getRootElement(), weaponSwitch )
See Also
Ped events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled