1
0
Fork 0
forked from Simnation/Main
Main/resources/[carscripts]/slashtires/bridge/framework/standalone/server.lua
2025-06-07 08:51:21 +02:00

25 lines
751 B
Lua

---Logger function
---@param source string
---@param event string
---@param message string
---@param data table
function Log(source, event, message, data)
print(source, event, string.format("[Slashtire] %s (%s) %s", GetPlayerName(source), source, message), json.encode(data, {indent = true}))
end
---Checks if the player can slash tires
---@param source string
---@param playerPed integer
---@return boolean canPlayerSlash
---@return string|nil reason nil if canPlayerSlash is true
function CanPlayerSlashTires(source, playerPed)
if GetEntityHealth(playerPed) == 0 then
return false, 'is_dead'
end
if IsPedHandcuffed(playerPed) then
return false, 'is_handcuffed'
end
return true
end