Fix - Screenshot-basic Fotoğraf Servisi [Discord Webhook]

Fivem.com.tr

Fivem.com.tr
Katılım
1 Eki 2022
Mesajlar
5,891
Tepki
74
Merhaba,

Herkesin sorun yaşadığı fotoğraf servis alanı, sitelerde belli bir zaman silinince fotoğraflar yok olması veya farklı fotoğrafların gelme sorunu yaşayan arkadaşlar için bir çözüm





1. gcphone/client/client.lua ' nın içinde aşağıdaki verdiğim kodu bulun



Kod:


Kod:
RegisterNUICallback('takePhoto', function(data, cb)
    CreateMobilePhone(1)
  CellCamActivate(true, true)
  takePhoto = true
  Citizen.Wait(0)
  if hasFocus == true then
    SetNuiFocus(false, false)
    hasFocus = false
  end
    while takePhoto do
    Citizen.Wait(0)

        if IsControlJustPressed(1, 27) then -- Toogle Mode
            frontCam = not frontCam
            CellFrontCamActivate(frontCam)
    elseif IsControlJustPressed(1, 177) then -- CANCEL
      DestroyMobilePhone()
      CellCamActivate(false, false)
      cb(json.encode({ url = nil }))
      takePhoto = false
      break
    elseif IsControlJustPressed(1, 176) then -- TAKE.. PIC
            exports['screenshot-basic']:requestScreenshotUpload(data.url, data.field, function(data)
        local resp = json.decode(data)
        DestroyMobilePhone()
        CellCamActivate(false, false)
        cb(json.encode({ url = resp.files[1].url }))   
      end)
      takePhoto = false
        end
        HideHudComponentThisFrame(7)
        HideHudComponentThisFrame(8)
        HideHudComponentThisFrame(9)
        HideHudComponentThisFrame(6)
        HideHudComponentThisFrame(19)
    HideHudAndRadarThisFrame()
  end
  Citizen.Wait(1000)
  PhonePlayAnim('text', false, true)
end)



2. Bulduğunuz kod ile aşağıdaki verdiğim kod ile değiştirin





Kod:


Kod:
RegisterNUICallback('takePhoto', function(data, cb)
    CreateMobilePhone(1)
  CellCamActivate(true, true)
  takePhoto = true
  Citizen.Wait(0)
  if hasFocus == true then
    SetNuiFocus(false, false)
    hasFocus = false
  end
    while takePhoto do
    Citizen.Wait(0)

        if IsControlJustPressed(1, 27) then -- Toogle Mode
            frontCam = not frontCam
            CellFrontCamActivate(frontCam)
    elseif IsControlJustPressed(1, 177) then -- CANCEL
      DestroyMobilePhone()
      CellCamActivate(false, false)
      cb(json.encode({ url = nil }))
      takePhoto = false
      break
    elseif IsControlJustPressed(1, 176) then -- TAKE.. PIC
      exports['screenshot-basic']:requestScreenshotUpload("WEBHOOK URL", data.field, function(data)
      local resp = json.decode(data)
      DestroyMobilePhone()
      CellCamActivate(false, false)
      cb(json.encode({ url = resp.attachments[1].proxy_url }))
    end)
      takePhoto = false
        end
        HideHudComponentThisFrame(7)
        HideHudComponentThisFrame(8)
        HideHudComponentThisFrame(9)
        HideHudComponentThisFrame(6)
        HideHudComponentThisFrame(19)
    HideHudAndRadarThisFrame()
  end
  Citizen.Wait(1000)
  PhonePlayAnim('text', false, true)
end)





3. Discord üzerinden kendinize bir webhook oluşturun, oluşturduğunuz webhooku "WEBHOOK URL" yerine yazın.


Bazen koca bir gün içerisindeki en önemli şey iki derin nefes arasındaki dinlenmemizdir. -Etty Hillesum

Konu alıntıdır, yanlış veya hatalı bir bilgi/paylaşım var ise yanıtlayabilir veya bizimle iletişime geçebilirsiniz.
 

Şu anda bu konu'yu okuyan kullanıcılar

Benzer konular

Üst