# Client\_Open

```
local QBCore = exports['qb-core']:GetCoreObject()
local playerPed = PlayerPedId()
-- Here you can add your Own Interaction Script or Target Script
RegisterNetEvent("peps:interactions:Show")
AddEventHandler("peps:interactions:Show", function()
    -- DONT CHANGE ANYTHING HERE UNLESS YOU KNOW WHAT YOU ARE DOING
    local hash = Config.WhitelistTimePed['hash']
    local coords = Config.WhitelistTimePed['timecheck_location']
    local sucesscoords = Config.WhitelistTimePed['success_ped_location']
    QBCore.Functions.LoadModel(hash)
    local timecheckPed = CreatePed(0, hash, coords.x, coords.y, coords.z-1.0, coords.w, false, false)
    local sucessPed = CreatePed(0, hash, sucesscoords.x, sucesscoords.y, sucesscoords.z-1.0, sucesscoords.w, false, false)
    -- Check Time Ped
    TaskStartScenarioInPlace(timecheckPed, 'WORLD_HUMAN_CLIPBOARD', true)
    FreezeEntityPosition(timecheckPed, true)
    SetEntityInvincible(timecheckPed, true)
    SetBlockingOfNonTemporaryEvents(timecheckPed, true)

    -- Success Ped
    TaskStartScenarioInPlace(sucessPed, 'WORLD_HUMAN_CLIPBOARD', true)
    FreezeEntityPosition(sucessPed, true)
    SetEntityInvincible(sucessPed, true)
    SetBlockingOfNonTemporaryEvents(sucessPed, true)  
    -- DONT CHANGE ANYTHING HERE UNLESS YOU KNOW WHAT YOU ARE DOING

  if Config.Target == true then
    --[[PEDS]]


    --Time Ped
    exports['qb-target']:AddTargetEntity(timecheckPed, {
        options = {
            {
                icon = 'fas fa-business-time',
                label = 'Check Whitelist Times',
                action = function()
                    local pedPos = GetEntityCoords(PlayerPedId())
                    local dist = #(pedPos - vector3(coords))
                    if dist <= 5.0 then
                        TriggerEvent('einreise:on')
                    end
                end,
            },
        },
        distance = 2.0
    })
    -- Success Ped
    exports['qb-target']:AddTargetEntity(sucessPed, {
      options = {
          {
              icon = 'fas fa-business-time',
              label = 'Leave Airport',
              action = function()
                  local pedPos = GetEntityCoords(PlayerPedId())
                  local dist = #(pedPos - vector3(sucesscoords))
                  if dist <= 5.0 then
                      TriggerEvent('peps:einreisetp:raus')
                  end
              end,
          },
      },
      distance = 2.0
  })

  -- [[ Animation PCs]]

  exports['qb-target']:AddBoxZone("animpc1", vector3(-1087.82, -2829.35, 27.71), 1, 1, {
    name = "animpc1",
    heading = 0,
    debugPoly = false,
    minZ=24.51,
    maxZ=28.51
  }, {
    options = {
        {
            
            event = "peps:einreiese:playanim",
            icon = "fas fa-hand",
            label = "Use PC",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })   

  exports['qb-target']:AddBoxZone("animpc2", vector3(-1086.84, -2829.91, 27.71), 1, 1, {
    name = "animpc2",
    heading = 0,
    debugPoly = false,
    minZ=24.51,
    maxZ=28.51
  }, {
    options = {
        {
            
            event = "peps:einreiese:playanim",
            icon = "fas fa-hand",
            label = "Use PC",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })   

  exports['qb-target']:AddBoxZone("animpc3", vector3(-1082.39, -2832.37, 27.71), 1, 1, {
    name = "animpc3",
    heading = 0,
    debugPoly = false,
    minZ=24.51,
    maxZ=28.51
  }, {
    options = {
        {
            
            event = "peps:einreiese:playanim",
            icon = "fas fa-hand",
            label = "Use PC",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })   

  exports['qb-target']:AddBoxZone("animpc4", vector3(-1081.31, -2833.14, 27.71), 1, 1, {
    name = "animpc4",
    heading = 0,
    debugPoly = false,
    minZ=24.51,
    maxZ=28.51
  }, {
    options = {
        {
            
            event = "peps:einreiese:playanim",
            icon = "fas fa-hand",
            label = "Use PC",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })   

  -- [[Ticket PCs]]

  exports['qb-target']:AddBoxZone("ticketpc1", vector3(-1083.32, -2819.57, 27.71), 1, 1, {
    name = "ticketpc1",
    heading = 0,
    debugPoly = false,
    minZ = 24.31,
    maxZ = 28.31,
  }, {
    options = {
        {
            
            event = "peps:einreiese:getitem",
            icon = "fas fa-hand",
            label = "Print Ticket",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })    

  exports['qb-target']:AddBoxZone("ticketpc2", vector3(-1073.48, -2821.53, 27.71), 1, 1, {
    name = "ticketpc2",
    heading = 0,
    debugPoly = false,
    minZ=24.11,
    maxZ=28.11
  }, {
    options = {
        {
            
            event = "peps:einreiese:getitem",
            icon = "fas fa-hand",
            label = "Print Ticket",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })    

  exports['qb-target']:AddBoxZone("ticketpc3", vector3(-1068.14, -2811.99, 27.71), 1, 1, {
    name = "ticketpc3",
    heading = 0,
    debugPoly = false,
    minZ=24.11,
    maxZ=28.11
  }, {
    options = {
        {
            
            event = "peps:einreiese:getitem",
            icon = "fas fa-hand",
            label = "Print Ticket",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })    

  exports['qb-target']:AddBoxZone("ticketpc4", vector3(-1077.83, -2810.1, 27.71), 1, 1, {
    name = "ticketpc4",
    heading = 0,
    debugPoly = false,
    minZ=24.11,
    maxZ=28.11
  }, {
    options = {
        {
            
            event = "peps:einreiese:getitem",
            icon = "fas fa-hand",
            label = "Print Ticket",
            job = Config.JobName
        }
    },
    distance = 1.5,
  })  


  elseif Config.Target == false then
    --[[PEDS]]

    --Time Ped
    exports.sleepless_interact:addCoords({
      id = "whitelisttimecheck",
      coords = Config.WhitelistTimePed['sleepless_interact_location'],
      options = {
          {
              text = "Check Whitelist Times",
              icon = "business-time",  -- Example simple FA icon name
              action = function(data) TriggerEvent('einreise:on') end,
              canInteract = function(entity, distance, coords, id)
                  return distance < 2.0 
              end
          }
      },
      renderDistance = 10.0,
      activeDistance = 2.0,
      cooldown = 1500
    })
    -- Success Ped
    exports.sleepless_interact:addCoords({
      id = "successwhitelistped",
      coords = Config.WhitelistTimePed['sleepless_interact_success_ped_location'],
      options = {
          {
              text = "Leave Airport",
              icon = "business-time",  -- Example simple FA icon name
              action = function(data) TriggerEvent('peps:einreisetp:raus') end,
              canInteract = function(entity, distance, coords, id)
                  return distance < 2.0 
              end
          }
      },
      renderDistance = 10.0,
      activeDistance = 2.0,
      cooldown = 1500
    })

    -- [[Animation PCS]]

    exports.sleepless_interact:addCoords({
      id = "whitelistpcs", --id that is stored in variable
      coords = {
        vector3(-1082.36, -2832.14, 27.6),
        vector3(-1080.81, -2833.11, 27.6),
        vector3(-1085.96, -2830.1, 27.59),
        vector3(-1088.04, -2828.92, 27.59)
      },
      options = {
          {
              text = "Use Computer",
              icon = "hand",  -- Example simple FA icon name
              action = function(data) 
                local Player = QBCore.Functions.GetPlayerData()
                local jobName = Player.job.name
                if jobName == 'police' then
                  TriggerEvent('peps:einreiese:playanim') 
                else
                  QBCore.Functions.Notify("Your not able to do that!")
                end
              end,
          }
      },
      renderDistance = 10.0,
      activeDistance = 2.0,
      cooldown = 1500
  })

  -- [[Ticket PCs]]

  exports.sleepless_interact:addCoords({
    id = "getticketpc", --id that is stored in variable
    coords = {
      vector3(-1083.02, -2819.73, 27.68),
      vector3(-1073.82, -2821.38, 27.68),
      vector3(-1068.35, -2811.77, 27.68),
      vector3(-1077.5, -2810.21, 27.68)
    },
    options = {
        {
            text = "Use Computer",
            icon = "hand",  -- Example simple FA icon name
            action = function(data) 
              local Player = QBCore.Functions.GetPlayerData()
              local jobName = Player.job.name
              if jobName == 'police' then
                TriggerEvent('peps:einreiese:getitem') 
              else
                QBCore.Functions.Notify("Your not able to do that!")
              end
            end,
        }
    },
    renderDistance = 10.0,
    activeDistance = 2.0,
    cooldown = 1500
})
  end
end)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://peps-docs.gitbook.io/peps-or-docs/scripts/whitelist/client_open.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
