forked from Simnation/Main
22 lines
553 B
Lua
22 lines
553 B
Lua
![]() |
if not QBCore then
|
||
|
QBCore = exports['qb-core']:GetCoreObject()
|
||
|
end
|
||
|
|
||
|
---Checks if the player can slash tires
|
||
|
---@return boolean canPlayerSlash
|
||
|
---@return string|nil reason nil if canPlayerSlash is true
|
||
|
function CanPlayerSlashTires()
|
||
|
local PlayerData = QBCore.Functions.GetPlayerData()
|
||
|
local metadata = PlayerData?.metadata
|
||
|
|
||
|
if metadata?.isdead or metadata?.inlaststand then
|
||
|
return false, 'is_dead'
|
||
|
end
|
||
|
|
||
|
if metadata?.ishandcuffed then
|
||
|
return false, 'is_handcuffed'
|
||
|
end
|
||
|
|
||
|
return true
|
||
|
end
|