IsPedReloadingWeapon

From Multi Theft Auto: Wiki
Revision as of 16:48, 18 February 2018 by Arran Fortuna (talk | contribs) (Created page with "__NOTOC__ {{Client function}} {{New items|3.0160|1.6| This function is used to determine whether or not a ped is currently reloading their weapon. Useful to stop certain quick...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Syntax

bool isPedReloadingWeapon ( ped thePed )

OOP Syntax Help! I don't understand this!

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


Required Arguments

  • thePed: The ped you are checking.

Returns

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

Example

Click to collapse [-]
Client

This example checks if the player who enters the 'amireloading' command is reloading and outputs a message.

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

See Also