Jump to content
RAGE Multiplayer Community

Mugshot / Pedshot - Upload to Server and then send to Imgur 1.0.1

   (4 reviews)

1 Screenshot

About This File

Hey all!

Included in the package are the following files:

1) packages/mugshot.js - include this from within your packages/index.js file such as require("mugshot");
2) client_packages/mugshot.js - include this in your client_packages/index.js such as require("./mugshot.js");
3) client_packages/mugshot (Folder) - upload this directly to your client_packages folder

To take a screen simply call the event: prepareScreenshot

  • Server side: player.call("prepareScreenshot");
  • Client side: mp.events.call("prepareScreenshot");

The process of taking a screenshot:

  1. Request the player headshot
  2. Wait 2 seconds for it to load (best result thanks to GTA Forums reference)
  3. Get the Pedheadshot TXD String for Sprite and set Variable to true to display sprite in Render event
  4. Sprite is shown on screen for 1 frame! 
  5. On the next call of Render - it will take a screenshot, which takes a screenshot of the previous frame.
  6. It will then stop processing the render event, unregister the pedheadshot and notify that a Headshot has been taken
  7. Client side will now trigger a HTML window to open ready to accept an event
  8. The event will trigger when the domReady is recieved and this event will contain the URL of the screenshot taken and the resolution of the game
  9. The HTML will then take the image, crop out only the mugshot and then convert it to base64 - roughly 50kb per mugshot
  10. The CEF will then notify Client Side to upload the data to the Server
  11. The server will recieve the Mugshot as a Base64 Image string (which can be decoded manually for testing at: https://base64.guru/converter/decode/image)
  12. It will then upload the Image currently to imgur with anonymous setting and provide you back the URL uploaded in console.

To use IMGUR 

  1. Go to https://api.imgur.com/oauth2/addclient - Log into your Imgur account and create an Application

  2. Set the type to Anonymous

  3. Set the callback URL to: https://www.getpostman.com/oauth2/callback

  4. Give it a name, email and description

  5. Click submit and you will get your Client ID - add this to packages/mugshot.js

 

NOTICE: You will see the mugshot appear on screen for a brief 1-2 frames however this is unavoidable no matter what I have tried as this is how the Screenshot tool takes the screenshot in the first place. 


What's New in Version 1.0.1   See changelog

Released

Fixed CEF link from packages to package to ensure it loads correctly

  • Like 1

User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest

DevMarvin

   1 of 1 member found this review helpful 1 / 1 member

i have never seen my face closer!👁️🦴

Link to comment
×
×
  • Create New...