Fivemerr
  • Fivemerr
    • πŸ€“Welcome to Fivemerr
  • API
    • βœ…Setup
    • πŸ–ΌοΈImages
    • πŸ”ŠAudio
    • πŸŽ₯Video
    • ℹ️Logs
  • Features
    • πŸ”„DB Backups
    • πŸ”‰Media
    • πŸ“­API Tokens
    • πŸ’»Servers
    • πŸͺ’Logs
    • πŸ•ΈοΈWebhooks
  • Script Integrations
    • πŸ“Έscreenshot-basic
    • 🀳ShareX
    • ℹ️Logs
      • ℹ️fm-logs
      • ℹ️ox_logs
      • ℹ️qb-logs
    • πŸ“ΆPhone Scripts
      • πŸ“³QBCore Phone
      • πŸ“³LB Phone
      • πŸ“³Road Phone
      • πŸ“³NPWD
      • πŸ“³JP Phone
      • πŸ“³nPhone
      • πŸ“΄okokPhone
      • πŸ“³GKS Phone
      • πŸ“³YSeries Phone
      • πŸ“΅QS Phone
    • πŸ¦₯Project Sloth
      • πŸ¦₯ps-mdt
      • πŸ¦₯ps-adminmenu
      • πŸ¦₯ps-camera
    • πŸ’ͺPower Scripts
      • πŸ’ͺpower_dashcams
    • πŸ“ΉSpy Scripts
      • πŸ“Ήspy-bodycam
Powered by GitBook
On this page
  • Server File Change
  • Client File Change
  1. Script Integrations
  2. Phone Scripts

QBCore Phone

PreviousPhone ScriptsNextLB Phone

Last updated 10 months ago

Every standard QB-Core server comes with screenshot-basic and qb-phone out of the box. This at present is configured to use Discord as a CDN.

To upgrade to Fivemerr, follow these simple instructions below:

Server File Change

  • Navigate to qb-phone/main/server/main.lua

  • Update WebHook to the Fivemerr API url based on your token type.

    • Missed the Fivemerr setup? You can find it

local WebHook = 'https://api.fivemerr.com/v1/media/images' -- Enter the API URL here
local WebHookKey = 'WEBHOOKKEY' -- Add this new var containing your API Key
  • On line 585/586 locate and find the following callback registration event

QBCore.Functions.CreateCallback('qb-phone:server:GetWebhook', function(_, cb)
    if WebHook ~= '' then
        cb(WebHook)
    else
        print('Set your webhook to ensure that your camera will work!!!!!! Set this on line 10 of the server sided script!!!!!')
        cb(nil)
    end
end)

Found it? Great!

Now replace it to this:

QBCore.Functions.CreateCallback('qb-phone:server:GetWebhook', function(_, cb)
    if WebHook ~= '' then
        cb(WebHook, WebHookKey)
    else
        print('Set your webhook to ensure that your camera will work!!!!!! Set this on line 10 of the server sided script!!!!!')
        cb(nil)
    end
end)

Client File Change

  • Navigate to qb-phone/main/client/main.lua

  • Search for exports['screenshot-basic']:requestScreenshotUpload within this file

  • You should find something similar to this:

QBCore.Functions.TriggerCallback('qb-phone:server:GetWebhook', function(hook)
    if not hook then
        QBCore.Functions.Notify('Camera not setup', 'error')
        return
    end
    exports['screenshot-basic']:requestScreenshotUpload(tostring(hook), 'files[]', function(data)
        SaveToInternalGallery()
        local image = json.decode(data)
        DestroyMobilePhone()
        CellCamActivate(false, false)
        TriggerServerEvent('qb-phone:server:addImageToGallery', image.attachments[1].proxy_url)
        Wait(400)
        TriggerServerEvent('qb-phone:server:getImageFromGallery')
        cb(json.encode(image.attachments[1].proxy_url))
        takePhoto = false
    end)
end)

Found it? Great!

Now update it to this:

QBCore.Functions.TriggerCallback('qb-phone:server:GetWebhook', function(hook, key)
    if not hook or not key then
        QBCore.Functions.Notify('Camera not setup', 'error')
        return
    end
    exports['screenshot-basic']:requestScreenshotUpload(tostring(hook), 'file', {
        headers = {
            Authorization = key
        } 
    }, function(data)
            SaveToInternalGallery()
            local image = json.decode(data)
            local link = (image and image.url) or 'invalid_url'
            DestroyMobilePhone()
            CellCamActivate(false, false)
            TriggerServerEvent('qb-phone:server:addImageToGallery', link)
            Wait(400)
            TriggerServerEvent('qb-phone:server:getImageFromGallery')
            cb(json.encode(link))
            takePhoto = false
    end)
end)

Restart your qb-phone or server and you're done πŸŽ‰!

πŸ“Ά
πŸ“³
here