SetWeaponFiringRate: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
Line 26: | Line 26: | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{Client weapon creation functions}} | {{Client weapon creation functions}} |
Latest revision as of 17:06, 7 November 2024
This function sets the firing rate to be used when a custom weapon is in firing state.
Syntax
bool setWeaponFiringRate ( weapon theWeapon, int firingRate )
OOP Syntax Help! I don't understand this!
- Method: weapon:setFiringRate(...)
- Variable: .firingRate
- Counterpart: getWeaponFiringRate
Required Arguments
- theWeapon: The weapon to modify the firing rate of.
- firingRate: The weapon firing rate. It seems to be a kind of frecuency value, so the lower the quicker the custom weapon will shoot.
Returns
Returns true on success, false otherwise.
Example
This example makes the Desert Eagle gun fire faster.
addEventHandler("onClientResourceStart", resourceRoot, function() local weapon = createWeapon ("deagle",0,0,10) -- create the weapon (deagle) setWeaponAmmo(weapon,5000) -- set weapon ammo to 5000 setWeaponState(weapon, "firing") -- in firing state. setWeaponFiringRate (weapon,2) -- change the weapon firing rate end )
See also
- createWeapon
- fireWeapon
- getWeaponAmmo
- getWeaponClipAmmo
- getWeaponFiringRate
- getWeaponFlags
- getWeaponOwner
- getWeaponProperty
- getWeaponState
- getWeaponTarget
- resetWeaponFiringRate
- setWeaponAmmo
- setWeaponClipAmmo
- setWeaponFiringRate
- setWeaponFlags
- setWeaponProperty
- setWeaponState
- setWeaponTarget