OnPedWeaponSwitch
Jump to navigation
Jump to search
This event is triggered when a ped switches weapons.
Parameters
int previousWeaponID, int currentWeaponID
- previousWeaponID: An integer representing the weapon that was switched from
- currentWeaponID: An integer 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
Player events
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled