- Documentation
- Shared functions
- reloadPedWeapon
Function
reloadPedWeapon
Makes a ped reload the weapon it is holding, as if the reload key was pressed. On the server the order goes to the player's game; for an NPC it is stored as a reload request. On the client it only works for the local player.
Syntax
bool reloadPedWeapon(ped ped)Arguments
pedped- A player or an NPC. On the client only
localPlayer.
Returns
true when the order was sent.
Example
addCommandHandler("przeladuj", function(player)
reloadPedWeapon(player)
end)
See also
getPedAmmoInClipReturns the number of rounds in the weapon's current clip, i.e. how many shots are left before reloading. Without a slot it refers to the weapon in hand; with a slot, to the weapon in that inventory slot. On the client it always refers to the weapon in hand.isPedReloadingWeaponChecks whether a ped is reloading right now. For a player it uses the state sent by their game, and it also returnstruefor the time set withsetPedReloadingWeapon. Useful e.g. to block actions while reloading.