OnPedWeaponSwitch

From Multi Theft Auto: Wiki
Revision as of 03:04, 27 September 2018 by Botder (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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