ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. isPedReloadingWeapon

Function

isPedReloadingWeapon

ServerPedsIdentical to MTA:SA

Checks whether a ped is reloading right now. For a player it uses the state sent by their game, and it also returns true for the time set with setPedReloadingWeapon. Useful e.g. to block actions while reloading.

Syntax

bool isPedReloadingWeapon(ped ped)

Arguments

pedped
A player or an NPC.

Returns

true while reloading.

Example

addCommandHandler("lecz", function(player)
    if isPedReloadingWeapon(player) then return end
    setElementHealth(player, 100)
end)

See also