> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-gangs/integrations/p_policejob.md).

# p\_policejob

Want to make handsup function work with our Crime Rope and p\_policejob? Follow this guide.

{% stepper %}
{% step %}

### Replace Files In p\_policejob

find directory `p_policejob/modules/client/handsup.lua`

Replace code inside with this:

```lua
if not Config.Handsup.Enabled then return end

local handsUp = false
local cfg = Config.Handsup

local function exportHandler(exportName, func)
    AddEventHandler(('__cfx_export_qb-smallresources_%s'):format(exportName), function(setCB)
        setCB(func)
    end)
end

exports('isHandsUp', function()
    return handsUp
end)

-- compatible with qb-smallresources
exportHandler('getHandsup', function()
    return handsUp
end)

RegisterCommand(cfg.Command, function()
    local state = LocalPlayer.state
    if exports['op-crime']:isRopeActive() or state.isDead or state.isCuffed or state.PhoneOpen then return end
    if Interactions and Interactions.isInCuffProcess then return end

    if handsUp then
        ClearPedSecondaryTask(cache.ped)
        handsUp = false
        return
    end

    local anim = cfg.Animation
    local dict = lib.requestAnimDict(anim.dict)
    TaskPlayAnim(cache.ped, dict, anim.clip, 2.0, 2.0, -1, 49, true)
    RemoveAnimDict(dict)
    handsUp = true

    local controls = cfg.DisableControls
    CreateThread(function()
        while handsUp do
            Wait(1)
            for i = 1, #controls do
                DisableControlAction(controls[i][1], controls[i][2], true)
            end
            if not IsEntityPlayingAnim(cache.ped, anim.dict, anim.clip, 3) then
                handsUp = false
            end
        end
    end)
end, false)

RegisterKeyMapping(cfg.Command, locale('hands_up'), 'keyboard', cfg.Key)
```

{% endstep %}

{% step %}

### Start Order

Make sure p\_policejob is strarted before op-crime!
{% endstep %}
{% endstepper %}
