OnPlayerWeaponReload
Jump to navigation
Jump to search
Parameters
int weapon, int ammoInClip, int ammo
- weapon: an int representing weapon used for firing a shot.
- ammoInClip: an int amount of ammo left for this weapon type in clip.
- ammo: an int amount of ammo left for this weapon type.
Source
The source of this event is the player who's reloading their weapon.
Canceling
If this event is canceled, then the players will not be able to reload their weapon manually by pressing R key. The weapons will still reload when the ammoInClip reaches zero. Using quickreload will also reload the weapon.
Example
This example will output informations when a player's weapon is reloading.
addEventHandler("onPlayerWeaponReload", root, function(weapon, ammoInClip, ammo) outputChatBox(getPlayerName(source) .. " is reloading their weapon: ") outputChatBox("Weapon: " .. getWeaponNameFromID(weapon)) outputChatBox("AmmoInClip: " .. ammoInClip) outputChatBox("Ammo: " .. ammo) end)
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