From 23018bdd06b194210fdaf9e1d2eb7c1dda7b804e Mon Sep 17 00:00:00 2001 From: ogi <50716143+ogidevs@users.noreply.github.com> Date: Thu, 9 Feb 2023 12:18:48 +0100 Subject: [PATCH] QB-Phone | Renewed | Imgur API integration As we all know discord cdn started blocking fivem's request for webhooks, so here is another solution. FOR THIS TO WORK YOU WILL NEED MY FORK OF SCREENSHOT-BASIC: https://github.com/citizenfx/screenshot-basic/pull/41 Do the necessary changes for screenshot-basic and you are all set. --- client/main.lua | 5 ++--- config.lua | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/main.lua b/client/main.lua index ebade20..b431538 100644 --- a/client/main.lua +++ b/client/main.lua @@ -616,13 +616,12 @@ RegisterNUICallback("TakePhoto", function(_, cb) QBCore.Functions.TriggerCallback("qb-phone:server:GetWebhook",function(hook) QBCore.Functions.Notify('Touching up photo...', 'primary') exports['screenshot-basic']:requestScreenshotUpload(tostring(hook), "files[]", function(uploadData) - local image = json.decode(uploadData) DestroyMobilePhone() CellCamActivate(false, false) - TriggerServerEvent('qb-phone:server:addImageToGallery', image.attachments[1].proxy_url) + TriggerServerEvent('qb-phone:server:addImageToGallery', uploadData.data.link) Wait(400) TriggerServerEvent('qb-phone:server:getImageFromGallery') - cb(json.encode(image.attachments[1].proxy_url)) + cb(json.encode(uploadData.data.link)) QBCore.Functions.Notify('Photo saved!', "success") OpenPhone() end) diff --git a/config.lua b/config.lua index 88d05f7..a150760 100644 --- a/config.lua +++ b/config.lua @@ -11,7 +11,7 @@ Config.BillingCommissions = { -- This is a percentage (0.10) == 10% } -- Web hook for camera ( NOT GO PRO ) -Config.Webhook = '' +Config.Webhook = 'imgur' -- Item name for pings app ( Having a VPN sends an anonymous ping, else sends the players name) Config.VPNItem = 'vpn'