isPedReloadingWeapon | Multi Theft Auto: Wiki Skip to content

isPedReloadingWeapon

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to determine whether or not a ped is currently reloading their weapon. Useful to stop certain quick reload exploits.

OOP Syntax Help! I don't understand this!

  • Method:ped:isReloadingWeapon(...)
  • Variable: .reloadingWeapon

Syntax

bool isPedReloadingWeapon ( ped thePed )
Required Arguments
  • thePed: The ped you are checking.

Returns

  • bool: value

Returns true if the ped is currently reloading a weapon, false otherwise.

Code Examples

shared

This example checks if the player who enters the/amireloadingcommand is reloading and outputs a message.

function isHeReloading( )
if isPedReloadingWeapon( localPlayer ) then
outputChatBox( "You are reloading a weapon" )
else
outputChatBox( "No, you're not reloading a weapon" )
end
end
addCommandHandler( "amireloading", isHeReloading )

See Also