Jump to content

Image Protection


Blinker.

Recommended Posts

Posted

Hello ,

i was wondering how to make the image go to cache like lua files .. so people can't simply take images of their mta folder..

Thanks in advance.

Posted

Make them cache?

Or just edit it with fileWrite functions, add some random character when stopping the script at the start of the image file, and remove it when loading, so it will be corrupted.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

  • Moderators
Posted

Or when you are a starter in lua, convert them to textures and delete them.

https://wiki.multitheftauto.com/wiki/DxCreateTexture

Like this:

local image = dxCreateTexture ( "filepath.png" ) 
fileDelete ("filepath.png") 
  
addEventHandler("onClientRender",root, 
function() 
   dxDrawImage(0,0,1000,1000,image) 
end) 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

If it's not a heavy file, you can encrypt them using somehing like:

https://wiki.multitheftauto.com/wiki/Base64Encode

https://wiki.multitheftauto.com/wiki/Base64Decode

addEventHandler('onClientResourceStart', resourceRoot, function() 
  local img = fileOpen('img_encrypted.png') 
  local pixels = base64Decode(fileRead(img, fileGetSize(img))) 
  fileClose(img) 
  local newImg = fileCreate("img.png") 
  fileWrite(newImg, pixels) 
  fileClose(newImg) 
  image = dxCreateTexture("img.png") 
  fileDelete("img.png") 
end) 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...