GetWeaponFiringRate

From Multi Theft Auto: Wiki
Revision as of 17:06, 7 November 2024 by Fernando187 (talk | contribs) (Remove obsolete Requirements section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This gets the firing rate to be used when a custom weapon opens fire.

Syntax

int getWeaponFiringRate ( weapon theWeapon )

OOP Syntax Help! I don't understand this!

Method: weapon:getFiringRate(...)
Variable: .firingRate
Counterpart: setWeaponFiringRate


Required Arguments

  • theWeapon: The weapon to modify the firing rate of.

Returns

Returns an integer with the firing rate of the custom weapon, false otherwise.

Example

This example creates a minigun at the center of the map and creates a /firerate command that outputs its firerate to the player who types it.

local weapon = createWeapon("minigun", 0, 0, 3)

function outputMinigunFireRate()
    outputChatBox("Fire rate: " .. getWeaponFiringRate(weapon))
end
addCommandHandler("firerate", outputMinigunFireRate)

See also