Quick Draw
Gives law enforcement a fast weapon draw and holster (knife speed by default) instead of the slow stock ox_inventory animation, with the cop pistol animation for every configured job.
Framework: Qbox. Requires: ox_lib, ox_inventory (with the small hook in install/ox_inventory_patch.md).
#Install
- Apply the three-line hook in
install/ox_inventory_patch.mdtoox_inventory/modules/weapon/client.lua. ensure GR1M_QuickDrawafter ox_inventory.
#Config
config.lua:
Jobs: job names and the minimum gradeActiveJobOnly,RequireOnDuty: which held jobs countDraw.ms,Holster.ms: times in millisecondsScaleAnim: speeds the animation up to fit the shorter timeCopPistolAnim: gives every configured job the police pistol drawGroups,ExcludeWeapons: which weapons it applies to
Everyone not in Config.Jobs keeps the stock timing.
Support: https://discord.gg/m38m33G6jK
Install: ox inventory patch
GR1M_QuickDraw changes the draw and holster time that ox_inventory uses. ox_inventory needs three small edits in ox_inventory/modules/weapon/client.lua. If GR1M_QuickDraw is stopped, the hook does nothing and stock timing is used.
#1. Add this function near the top of the file (after the anims table)
-- GR1M_QuickDraw hook: that resource can shorten draw/holster time for its configured jobs.
-- Does nothing unless GR1M_QuickDraw is started; any error falls back to the stock timing.
local function quickDraw(kind, anim, sleep, hash)
if GetResourceState('GR1M_QuickDraw') ~= 'started' then return anim, sleep end
local ok, newAnim, newSleep = pcall(function()
return exports.GR1M_QuickDraw:Adjust(kind, anim, sleep, hash)
end)
if ok and type(newSleep) == 'number' then return newAnim, newSleep end
return anim, sleep
end
#2. In Weapon.Equip, after the line sleep = anim and anim[3] or 1200, add
anim, sleep = quickDraw('draw', anim, sleep, data.hash)
#3. In Weapon.Disarm, after the line local sleep = anim and anim[6] or 1400, add
anim, sleep = quickDraw('holster', anim, sleep, currentWeapon.hash)
Restart ox_inventory (or the server) after saving.
GR1M