onPlayerScreenShot | Multi Theft Auto: Wiki Skip to content

onPlayerScreenShot

Client-side
Server-side
Shared

This event is triggered when the screen capture requested by takePlayerScreenShot has completed.

Parameters

resource theResource, string status, string imageData, int timestamp, string tag
  • theResource: the resource which called takePlayerScreenShot.
  • status: a string containing the status of the event which can be one of these values: "ok" - the image capture was successful and imageData will contain a JPEG image. "disabled" - the image capture failed because the player has disabled screen uploads. "minimized" - the image capture failed because the player has minimized the screen (i.e. alt-tabbed). "error" - the image capture failed because of an unspecified error.
  • imageData: a string which contains the JPEG image data. This can be saved with the file functions, or sent to players with triggerClientEvent or even uploaded to a web site.
  • timestamp: an int representing the server tick count when the capture was taken.
  • tag: a string passed to takePlayerScreenShot.

Source

element: The source of this event is the player

Code Examples

server
--------------------------------------------------
-- Take screen shot every 2 seconds
function doTakeScreenShot()
takePlayerScreenShot( getRandomPlayer(), 320, 200 )
end
setTimer(doTakeScreenShot, 2000, 0)
--------------------------------------------------
-- Receive screen shot result
addEventHandler( "onPlayerScreenShot", root,
function ( theResource, status, pixels, timestamp, tag )
triggerClientEvent( root, "onMyClientScreenShot", resourceRoot, pixels ) -- Relay to all players
end
)

See Also