Import image from another ressource

hi,

i want to know if there is any solution for import some png from another resource?

thx.

you can probaly try using GetResourcePath(“name of resource”);
example

const root = GetResourcePath(GetCurrentResourceName());
fs.readFile(`${root}/test.txt`,

Uhhm, don’t use fs.readFile, client wouldn’t have access to reading any files not using the native LoadResourceFile - FiveM Natives @ Cfx.re Docs

You need to call to the first resource image file in your fxmanifest of the second resource
image
and then you call to the nui: page of the first resource that contains the image in your second resource

it was an example
and yes you cant read and write files client side it could be used for making evil scripts
it was meant to show that you get the resouces root path and you can then index into what file you need

But that’s not how you would do that on FiveM

1 Like