mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-16 03:07:34 +00:00
add name to screen
This commit is contained in:
parent
ac216b558f
commit
f92c15c925
|
@ -33,9 +33,10 @@ function gmInte.openAdminConfig()
|
||||||
gmInte.SendNet(2)
|
gmInte.SendNet(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
function gmInte.takeScreenShot(serverID, authToken)
|
local ScreenshotRequested = false
|
||||||
gmInte.config.id = serverID
|
hook.Add("PostRender", "gmInteScreenshot", function()
|
||||||
gmInte.config.token = authToken
|
if (!ScreenshotRequested) then return end
|
||||||
|
ScreenshotRequested = false
|
||||||
|
|
||||||
local captureData = {
|
local captureData = {
|
||||||
format = "png",
|
format = "png",
|
||||||
|
@ -53,7 +54,8 @@ function gmInte.takeScreenShot(serverID, authToken)
|
||||||
{
|
{
|
||||||
["steamID64"] = LocalPlayer():SteamID64(),
|
["steamID64"] = LocalPlayer():SteamID64(),
|
||||||
["screenshot"] = screenCapture,
|
["screenshot"] = screenCapture,
|
||||||
["options"] = captureData
|
["options"] = captureData,
|
||||||
|
["name"] = LocalPlayer():Nick()
|
||||||
},
|
},
|
||||||
function(code, body)
|
function(code, body)
|
||||||
gmInte.log("Screenshot sent to Discord", true)
|
gmInte.log("Screenshot sent to Discord", true)
|
||||||
|
@ -62,6 +64,15 @@ function gmInte.takeScreenShot(serverID, authToken)
|
||||||
gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true)
|
gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
file.Write( "image.png", data )
|
||||||
|
end)
|
||||||
|
|
||||||
|
function gmInte.takeScreenShot(serverID, authToken)
|
||||||
|
gmInte.config.id = serverID
|
||||||
|
gmInte.config.token = authToken
|
||||||
|
|
||||||
|
ScreenshotRequested = true
|
||||||
end
|
end
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user