local WebHook ='https://api.fivemerr.com/v1/media/images' -- Enter the API URL herelocal 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 ~='' thencb(WebHook)elseprint('Set your webhook to ensure that your camera will work!!!!!! Set this on line 10 of the server sided script!!!!!')cb(nil)endend)
Found it? Great!
Now replace it to this:
QBCore.Functions.CreateCallback('qb-phone:server:GetWebhook', function(_,cb)if WebHook ~='' thencb(WebHook, WebHookKey)elseprint('Set your webhook to ensure that your camera will work!!!!!! Set this on line 10 of the server sided script!!!!!')cb(nil)endend)
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)ifnot hook then QBCore.Functions.Notify('Camera not setup', 'error')returnend 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 =falseend)end)
Found it? Great!
Now update it to this:
QBCore.Functions.TriggerCallback('qb-phone:server:GetWebhook', function(hook,key)ifnot hook ornot key then QBCore.Functions.Notify('Camera not setup', 'error')returnend 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 =falseend)end)
Restart your qb-phoneor server and you're done π!