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

I can’t help, i gave up on this mess.

i have this error how can i solve this

1 Like

good evening, I would like to know about LINUX and I can not install it, how can I please

Can you help me pls my screenshot-basic not working for me

EDIT : nvm i fixed yarn problem :slight_smile:

How you fix ? Can you tell

Option 1: Change your default code page of Windows console to UTF-8 (Windows 10)

Start -> Run -> regedit
Go to [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun]
Change the value to chcp 65001

Option 2: Use this batch file (Other Win Versions(2012 Server))

@ECHO OFF
REM change CHCP to UTF-8
CHCP 65001
CLS

Option 3: (if 1 or 2 didnt work)

1) System's Language settings
2) Select Administrative language settings
3) Change system locale
4) Check the Beta: Use Unicode UTF-8 for worldwide language support box
5) Restart PC.

Option 4: Use a server manager that has its own cmd prompt
Here
or
Here

1 Like

I dont have “Autorun” file.? What i need to do

Option 1-2-3 not work for me and ı cant be understand what ı am gonna be do with option 4 ?

I’ve done some testings with NVIDIA and AMD cards and it works fine on NVIDIA but with AMD GPUs I always get black screenshots, maybe It’s related with this https://github.com/mrdoob/three.js/issues/14137

EDIT: Maybe its a problem with the GLSL because AMD GLSL compiler its strict while NVIDIA’s compiler is laxer https://www.geeks3d.com/20101002/tips-how-to-quickly-test-glsl-shaders-for-ati-on-a-nvidia-system/

EDIT2: Sorry for too many edits, after some tests I found GLSL is working as intended, I think the trick with the CfxTexture is not working on AMD GPUs :confused:

2 Likes

have you fixed it ?

As Nowimps8 said try adding on top of your server “.bat” but with 850 instead

@ECHO OFF
CHCP 850
CLS

Any solution for this?

Could not start dependency webpack for resource screenshot-basic.
musl libc (x86_64)
Version 1.1.22
Dynamic Program Loader
Usage: /home/dev/fx-server/alpine/opt/cfx-server/ld-musl-x86_64.so.1 [options] [--] pathname [args]
retrieved banlist
Building resource webpack failed.
Error data: yarn failed!

Just updated cfx, same thing

Its because yarn is not working on Linux, check this Webpack on Linux Server

If you have a windows machine you can take a workaround following this steps:

  • Create a fivem server on windows and add this resource to it.
  • Add “start yarn” and “start screenshot-basic” to your server.cfg.
  • Start the server and let it build the resource webpack.
  • Open the “__resource.lua” of screenshot-basic and remove the following lines:
> dependency 'yarn'
> dependency 'webpack'
> webpack_config 'client.config.js'
> webpack_config 'server.config.js'
> webpack_config 'ui.config.js'
  • Delete the following files and folders (not needed because the resource is builded now)

node_modules
src
ui
client.config.js
server.config.js
ui.config.js
yarn.lock
dist\ui.js

  • Move the screenshot-basic resource folder to your Linux server and it’s ready to go :wink:

Sorry for my bad english, hope this helps you :slight_smile:

4 Likes

Why does it when you upload to wew.wtf/upload.php it shares the same link, so after you have taken a screenshot of a client it only shows the first screenshot as a new link is not generated.

It took me a while to understand your problem :sweat_smile:
The data you get back after uploading an screenshot it’s sent by the remote server and can be happening two things:

  1. The remote upload server is not sending any data to access the image (if it sends it back, don’t confuse with request url) or its faulty.
  2. The response from the remote upload it’s being cached and that’s why you get alwais the same url back.

With the first case if it’s your own service check it sends back valid information, if it’s a third party service I can’t help you with it.

In the second case you have to add an small modification to the code and rebuild the resource, I recommend you doing this with a fresh copy of screenshot-basic before runing the resource. Under line 173 and 184 of ui/src/main.ts (https://github.com/citizenfx/screenshot-basic/blob/de9ecac9e7ec90aeda4260d54b34e5f87ee6fa93/ui/src/main.ts#L173 https://github.com/citizenfx/screenshot-basic/blob/de9ecac9e7ec90aeda4260d54b34e5f87ee6fa93/ui/src/main.ts#L184) add the following line.

cache: ‘no-store’,

so you will end having this

mode: ‘cors’,
cache: ‘no-store’,
body: (request.targetField) ? getFormData() : JSON.stringify({

mode: ‘cors’,
cache: ‘no-store’,
body: JSON.stringify({

Note: Be carefull copying this because quotes get stylished here and you need simple quotes.

Hope this helps you :slight_smile:

So I have good news and bad news.

Good news is that it is making a fresh new link per upload unlike before, confirming the latter of the 2 problems you suggested is the problem.

Bad news is that it isn’t taking a fresh image. Although a new link is being returned I think it is caching the first screenshot therefore if I move and then take another screenshot it would still show what I had before I moved.

I done this with a fresh version of screenshot-basic.

What export should i use to get my screenshot uploaded to the resource folder or somewhere on my server files

@mmando

exports['screenshot-basic']:requestClientScreenshot(GetPlayers()[1], {
    fileName = 'cache/screenshot.jpg'
}, function(err, data)
    print('err', err)
    print('data', data)
end)

This when called by the server to all or a specific client will save a screenshot as a .jpg to the cache, the location can be changed to see fit.

Did you fix the black screen?

1 Like

Before you connect to the server make sure FiveM is in fullscreen.