Jaksam Job Creator

You have to edit the following file:

jobs_creator/client/actions/actions.lua

In most versions you can access this file. If not, the you can't implement it.

Edit Menu Options

client/actions/actions.lua
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_put_handcuffs'), value = 'cuff', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_put_hardcuffs'), value = 'hardcuff', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_take_handcuffs'), value = 'uncuff', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_headbag'), value = 'headbag', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_tape'), value = 'tape', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_ankletracker'), value = 'ankletracker', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_start_dragging'), value = 'drag', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_put_in_car'), value = 'putInCar', type = 'player'},
{condition = JobsCreator.activeActions.canHandcuff, label = getLocalizedText('actions_take_from_car'), value = 'takeFromCar', type = 'vehicle'},

Do NOT forget to add the LocalizedText to the jobs_creator/locals files!

-- English
['actions_put_handcuffs'] = "Cuff",
['actions_put_hardcuffs'] = "Hardcuff",
['actions_take_handcuffs'] = "Uncuff",
['actions_ankletracker'] = "AnkleTracker",
['actions_headbag'] = "Headbag",
['actions_tape'] = "Tape",

-- German
['actions_put_handcuffs'] = "Handfesseln anlegen",
['actions_put_hardcuffs'] = "Fußfesseln anlegen",
['actions_take_handcuffs'] = "Handfesseln ablegen",
['actions_ankletracker'] = "Fusfessel",
['actions_headbag'] = "Kopfsack",
['actions_tape'] = "Klebeband",

Replace isHandcuffed function

if (exports['msk_handcuffs']:getIsHandcuffed()) then
    notifyClient(getLocalizedText("you_cant_while_handcuffed"))
    return
end

Edit Menu Actions

client/actions/actions.lua
local function openActionsMenu()
    if not canDoAnyAction or not actionsMenuEnabled or IsPedDeadOrDying(PlayerPedId()) then return end
    if(canDoAnyAction and (not config.canUseActionsMenuWhileOffDuty and not isOnDuty)) then
        notifyClient(getLocalizedText("you_are_not_on_duty"))
        return
    end

    if (exports['msk_handcuffs']:getIsHandcuffed()) then
        notifyClient(getLocalizedText("you_cant_while_handcuffed"))
        return
    end

    Framework.menu().CloseAll()

    Framework.menu().Open('default', GetCurrentResourceName(), 'actions_menu', {
        title = getLocalizedText('actions_menu'),
        align = config.menuPosition,
        elements = menuElements
    }, 
    function(data, menu) 
        local action = data.current.value
        local extraData = data.current.extraData
        local playerJob = ESX.GetPlayerData().job.name or 'unemployed'

        -- Default Options for every Player and Job
        local defaultItems = {
            cuffItem = 'cable_ties',
            hardcuffItem = 'hardcuff',
            uncuffItem = 'scissors',
            enableAnkletracker = false, 
            enableHeadbag = true,
            enableTape = true,
        }

        -- Specific Options for Jobs
        local jobs = {
            ['police'] = {
                cuffItem = 'cuffs',
                hardcuffItem = 'hardcuff',
                uncuffItem = 'cuff_keys',
                enableAnkletracker = true,
                enableHeadbag = true,
                enableTape = true,
            },
            ['doj'] = {
                cuffItem = 'cuffs',
                hardcuffItem = 'hardcuff',
                uncuffItem = 'cuff_keys',
                enableAnkletracker = true,
                enableHeadbag = true,
                enableTape = true,
            },
        }

        if action == 'cuff' then
            exports.msk_handcuffs:cuffPlayer(jobs[playerJob] and jobs[playerJob].cuffItem or defaultItems.cuffItem)
        elseif action == 'hardcuff' then
            exports.msk_handcuffs:hardcuffPlayer(jobs[playerJob] and jobs[playerJob].hardcuffItem or defaultItems.hardcuffItem)
        elseif action == 'uncuff' then 
            exports.msk_handcuffs:uncuffPlayer(jobs[playerJob] and jobs[playerJob].uncuffItem or defaultItems.uncuffItem)
        elseif action == 'ankletracker' then 
            if jobs[playerJob] and jobs[playerJob].enableAnkletracker or defaultItems.enableAnkletracker then
                exports.msk_handcuffs:ankleTrackerPlayer()
            else
                notifyClient('You are not allowed to do that!')
            end
        elseif action == 'headbag' then 
            if jobs[playerJob] and jobs[playerJob].enableHeadbag or defaultItems.enableHeadbag then
                exports.msk_handcuffs:headbagPlayer()
            else
                notifyClient('You are not allowed to do that!')
            end
        elseif action == 'tape' then 
            if jobs[playerJob] and jobs[playerJob].enableTape or defaultItems.enableTape then
                exports.msk_handcuffs:tapePlayer()
            else
                notifyClient('You are not allowed to do that!')
            end
        elseif action == 'drag' then
            local player, distance = ESX.Game.GetClosestPlayer()

            if player ~= -1 and distance <= 2.5 then
                TriggerServerEvent('msk_handcuffs:setDrag', GetPlayerServerId(player))
            end
        elseif action == 'putInCar' then
            local player, distance = ESX.Game.GetClosestPlayer()

            if player ~= -1 and distance <= 2.5 then
                TriggerServerEvent('msk_handcuffs:putInCar', GetPlayerServerId(player))
            end
        elseif action == 'takeFromCar' then
            local player, distance = ESX.Game.GetClosestPlayer()

            if player ~= -1 and distance <= 2.5 then
                TriggerServerEvent('msk_handcuffs:outOfCar', GetPlayerServerId(player))
            end
        else
            TriggerEvent(Utils.eventsPrefix .. ':actions:' .. action, extraData)
        end
    end,
    function(data, menu)
        menu.close()
    end)
end

Last updated