[API/dev resource] screenshot-basic - make screenshots of clients' games!

how to fix yarn ?

same, did u ever fixed it?

try dumping response to see?

Files is not a variable you have defined. But response and data are available.

it only works when sending straight to chat, it cant upload for some reason tried so many things, no post data and other errors… well, nvm.
it works though sharex ¯\(ツ)


“this is my script error. How I can fix that?”

you are using maybe skincreator ?


Gcphone picture taking, used to work before but doesnt work anymore. How could i fix this? :slight_smile:

i am having the same issue. Anyone know that fix please share!

Same issue for me, failed to fetch…

how do you get to make a screenshot, it does not work for me, the resource is loaded and everything. can somone explain in detail. the read me didn’t help me at all

Its a API… So you have to make a script that uses this api to make a screenshot.

Hello all. I found this edited resource: https://github.com/jonassvensson4/screenshot-basic
Since wew.wtf is down for image uploads then i decided to try imgur, but most of the scripts like gcphone or EasyAdmin are in lua. But in readme is only JS export. Can anybody help me that export to LUA, please? Im talking about this:

// Imgur client ID
const CLIENT_ID = 'changeThis';

exports['screenshot-basic'].requestScreenshotUpload(`https://api.imgur.com/3/upload`, 'imgur', {
   headers: {
      'authorization': `Client-ID ${ CLIENT_ID }`,
      'content-type': 'multipart/form-data'
   }
}, ( data ) => {
   console.log(JSON.parse(data).data.link);
});

Thanks for any try

1 Like

Ask the author of ‘that edited resource’.

1 Like

Can u please help me how to use your screenshot-basic from your github in LUA (gcphone for example), please?

I’m not sure why you would need another example in LUA since there’s already a example in the original repo that you could look at. I’ve just added a headers object to the already existing options object.

Yeah, but thats not for imgur with client ID. I have biggest problem with headers. I dont know should i define them in lua.

1 Like
	exports['screenshot-basic']:requestScreenshotUpload('https://api.imgur.com/3/upload', 'imgur', {
	headers = {
	authorization = 'Client-ID 78548554',
	content-type = 'multipart/form-data'
	}
	}, function(data)
        local resp = json.decode(data)
        DestroyMobilePhone()
        CellCamActivate(false, false)
        cb(json.encode({url = resp.link}))   
		print(resp.link)
      end)

Good,
Thanks to @jsfour we have managed to fix the gcphone with screenshot.

  1. Install this version of Screenshot-Basic ( GitHub - jonassvensson4/screenshot-basic: FiveM client screenshot resource - Imgur, crop options and headers support)
  2. GcPhone client.lua change lines 754-759 for:
 exports['screenshot-basic']:requestScreenshotUpload(data.url, data.field,{
        headers = {
          ['authorization'] = string.format('Client-ID %s', 'ID IMGUR'),
          ['content-type'] = 'multipart/form-data'
        }
      },function(data)
        local resp = json.decode(data)
        DestroyMobilePhone()
        CellCamActivate(false, false)
        cb(json.encode({ url = resp.data.link  }))
        PhonePlayAnim('text', false, true)
      end)
  1. gcphone config.json lines 38-39 change for:
  "fileUploadService_Url": "https://api.imgur.com/3/upload",
  "fileUploadService_Field": "imgur",
  1. enjoy
2 Likes

Would you happen to have a fixed version of gcphone that works with the latest esx update?