From Multi Theft Auto: Wiki
This event is triggered when a ped switches weapons.
int previousWeaponID, int currentWeaponID
- previousWeaponID: an int representing the weapon that was switched from.
- currentWeaponID: an int representing the weapon that was switched to.
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 )