client/editable.lua

function isPlayerAdmin()
    return PlayerData.perm ~= "user"
end

function canOpen()
    if not PlayerData then PlayerData = exports["tgiann-core"]:getPlayerData() end
    return not IsNuiFocused() and not IsDisabledControlPressed(0, 19) and inventoryActive and not isDead and not IsPauseMenuActive() and not phoneOpen and playerLoaded
end

function emote(text, type)
    TriggerServerEvent('3dme:display', text, "me", false, false)
end

function opened()
    TriggerEvent("tgiann-hud:ui", false)
end

function closed()
    TriggerEvent("tgiann-hud:ui", true)
end

function disableClotheButton()
   --[[  local onDuty = false
    if PlayerData.job.name == "police" then
        onDuty = PlayerData.job.onduty
    end
    return exports["tgiann-clothing"]:scriptClotheIsActive() or onDuty or (exports["tgiann-event"]:joinedAnyEvent() and true or false ) or exports["tgiann-clothing"]:isInspect() ]]
    return false
end

function getTrunkData(vehicle)
    local class = GetVehicleClass(vehicle)
    local maxweight, slots
    if class == 0 then -- Compacts  
        maxweight = 50000
        slots = 10
    elseif class == 1 then -- Sedans  
        maxweight = 50000
        slots = 10
    elseif class == 2 or class == 9 then -- SUVs, Off-road  
        maxweight = 250000
        slots = 10
    elseif class == 12 then -- vans 
        maxweight = 450000
        slots = 20
    elseif class == 20 then -- commercial 
        maxweight = 800000
        slots = 40
    elseif class == 3 or class == 4 then -- Coupes, Muscle  
        maxweight = 25000
        slots = 10
    elseif class == 13 or class == 8 then -- Cycles  
        maxweight = 2000
        slots = 1
    elseif class == 5 then -- Sports Classics
        maxweight = 12000
        slots = 10
    elseif class == 6 then -- Sports  
        maxweight = 10000
        slots = 10
    elseif class == 7 then -- Super  
        maxweight = 8000
        slots = 5
    elseif class == 11 then -- Super  
        maxweight = 10000
        slots = 5
    else
        maxweight = 25000
        slots = 10
    end

--[[     if string.match(tgiCore.trim(GetVehicleNumberPlateText(vehicle)), "%d%d%d%S%S%S%d%d") == nil then
        maxweight = 5000
        slots = 1
    end ]]

    if GetEntityModel(vehicle) == `bcat` then
        maxweight = 10000000
        slots = 200
    end

    return {
        maxweight = maxweight,
        slots = slots,
    }
end

function removeWeaponCustom()
    --[[ if exports["tgiann-pvpinventory"]:isActive() then
        SetCurrentWeapon()
        return true
    end ]]
    return false
end

function dropWeaponWhenDieEditable()
    --[[ local zoneIsRed = exports["tgiann-safezone"]:getZoneType() == "red"
    if zoneIsRed and exports["tgiann-police"]:playerIsPolice() then
        return
    end ]]
    return true
end

Last updated