ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPlayerScreenShot

Event

onPlayerScreenShot

ServerPlayersIdentical to MTA:SA

The result of takePlayerScreenShot arrives: a JPEG of the player's game frame (without the script overlay) or information that it failed.

Handler

addEventHandler("onPlayerScreenShot", root, function(theResource, status, imageData, timestamp, tag) ... end)

Parameters

theResourceresource
The resource that asked.
statusstring
"ok", "minimized" or "error".
imageDatastring
JPEG data.
timestampint
When it was taken.
tagstring
The tag from takePlayerScreenShot.

Source

source is the player.

Example

addEventHandler("onPlayerScreenShot", root, function(_, status, data, _, tag)
    if status == "ok" then
        local f = fileCreate("zrzuty/" .. getPlayerName(source) .. ".jpg")
        fileWrite(f, data)
        fileClose(f)
    end
end)

See also