Main/resources/[carscripts]/slashtires/bridge/framework/standalone/client.lua

18 lines
580 B
Lua
Raw Normal View History

2025-06-07 08:51:21 +02:00
---Checks if the player can slash tires
---@return boolean canPlayerSlash
---@return string|nil reason nil if canPlayerSlash is true
function CanPlayerSlashTires()
local playerPed = PlayerPedId()
if IsPedDeadOrDying(playerPed, true) then
return false, 'is_dead'
end
-- Checks if the ped has the CPED_CONFIG_FLAG_IsHandCuffed flag or is playing a cuffed anim
if GetPedConfigFlag(playerPed, 120, true) or IsEntityPlayingAnim(playerPed, 'mp_arresting', 'idle', 3) then
return false, 'is_handcuffed'
end
return true
end