mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
screenshot player
This commit is contained in:
parent
98865fd582
commit
016ad6187b
|
@ -1,5 +1,5 @@
|
||||||
local function saveConfig(setting, value)
|
local function saveConfig(setting, value)
|
||||||
gmInte.SendNet("3", {
|
gmInte.SendNet(3, {
|
||||||
[setting] = value
|
[setting] = value
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -104,6 +104,7 @@ local possibleConfig = {
|
||||||
["label"] = "Sync Chat",
|
["label"] = "Sync Chat",
|
||||||
["description"] = "Sync chat between the server and the discord server.",
|
["description"] = "Sync chat between the server and the discord server.",
|
||||||
["websocket"] = true,
|
["websocket"] = true,
|
||||||
|
["restart"] = true,
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
["value"] = function(setting, value)
|
["value"] = function(setting, value)
|
||||||
return value
|
return value
|
||||||
|
@ -117,6 +118,7 @@ local possibleConfig = {
|
||||||
["label"] = "Sync Ban",
|
["label"] = "Sync Ban",
|
||||||
["description"] = "Sync chat between the server and the discord server.",
|
["description"] = "Sync chat between the server and the discord server.",
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
|
["disable"] = true,
|
||||||
["value"] = function(setting, value)
|
["value"] = function(setting, value)
|
||||||
return value
|
return value
|
||||||
end,
|
end,
|
||||||
|
@ -129,6 +131,7 @@ local possibleConfig = {
|
||||||
["label"] = "Sync Timeout",
|
["label"] = "Sync Timeout",
|
||||||
["description"] = "Sync chat between the server and the discord server.",
|
["description"] = "Sync chat between the server and the discord server.",
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
|
["disable"] = true,
|
||||||
["value"] = function(setting, value)
|
["value"] = function(setting, value)
|
||||||
return value
|
return value
|
||||||
end,
|
end,
|
||||||
|
@ -141,6 +144,7 @@ local possibleConfig = {
|
||||||
["label"] = "Sync Kick",
|
["label"] = "Sync Kick",
|
||||||
["description"] = "Sync chat between the server and the discord server.",
|
["description"] = "Sync chat between the server and the discord server.",
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
|
["disable"] = true,
|
||||||
["value"] = function(setting, value)
|
["value"] = function(setting, value)
|
||||||
return value
|
return value
|
||||||
end,
|
end,
|
||||||
|
@ -153,6 +157,7 @@ local possibleConfig = {
|
||||||
["label"] = "Force Player Verif",
|
["label"] = "Force Player Verif",
|
||||||
["description"] = "Sync chat between the server and the discord server.",
|
["description"] = "Sync chat between the server and the discord server.",
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
|
["disable"] = true,
|
||||||
["value"] = function(setting, value)
|
["value"] = function(setting, value)
|
||||||
return value
|
return value
|
||||||
end,
|
end,
|
||||||
|
@ -165,6 +170,7 @@ local possibleConfig = {
|
||||||
["label"] = "Support Link",
|
["label"] = "Support Link",
|
||||||
["description"] = "Server ID found on the webpanel.",
|
["description"] = "Server ID found on the webpanel.",
|
||||||
["type"] = "textEntry",
|
["type"] = "textEntry",
|
||||||
|
["disable"] = true,
|
||||||
["value"] = function(setting, value)
|
["value"] = function(setting, value)
|
||||||
return value
|
return value
|
||||||
end,
|
end,
|
||||||
|
@ -186,24 +192,20 @@ local possibleConfig = {
|
||||||
end,
|
end,
|
||||||
["category"] = "Other"
|
["category"] = "Other"
|
||||||
},
|
},
|
||||||
|
['devInstance'] = {
|
||||||
|
["label"] = "Dev Instance",
|
||||||
|
["description"] = "Activate or deactivate the dev instance of the API and Websocket.",
|
||||||
|
["type"] = "checkbox",
|
||||||
|
["value"] = function(setting, value)
|
||||||
|
return value
|
||||||
|
end,
|
||||||
|
["onEdit"] = function(setting, value)
|
||||||
|
saveConfig(setting, value == "Enabled" && true || false)
|
||||||
|
end,
|
||||||
|
["category"] = "Other"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
// if data.websocket is false add button to download websocket
|
|
||||||
if !data.websocket then
|
|
||||||
local button = vgui.Create("DButton")
|
|
||||||
button:SetText("Download Websocket")
|
|
||||||
button.DoClick = function()
|
|
||||||
gui.OpenURL("https://github.com/FredyH/GWSockets/releases")
|
|
||||||
end
|
|
||||||
button:SetSize(buttonGrid:GetColWide(), buttonGrid:GetRowHeight())
|
|
||||||
buttonGrid:AddItem(button)
|
|
||||||
end
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
local buttonsInfo = {
|
local buttonsInfo = {
|
||||||
{
|
{
|
||||||
["label"] = "Open Webpanel",
|
["label"] = "Open Webpanel",
|
||||||
|
@ -214,7 +216,7 @@ local buttonsInfo = {
|
||||||
{
|
{
|
||||||
["label"] = "Test Connection",
|
["label"] = "Test Connection",
|
||||||
["func"] = function()
|
["func"] = function()
|
||||||
gmInte.SendNet("1")
|
gmInte.SendNet(1)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -231,10 +233,67 @@ local buttonsInfo = {
|
||||||
["func"] = function()
|
["func"] = function()
|
||||||
gui.OpenURL("https://github.com/FredyH/GWSockets/releases")
|
gui.OpenURL("https://github.com/FredyH/GWSockets/releases")
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
["label"] = "Load Server Config",
|
||||||
|
["condition"] = function(data)
|
||||||
|
return data.debug
|
||||||
|
end,
|
||||||
|
["func"] = function(data)
|
||||||
|
gmInte.config = data
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gmInte.needRestart()
|
||||||
|
local frame = vgui.Create("DFrame")
|
||||||
|
frame:SetSize(400, 120)
|
||||||
|
frame:Center()
|
||||||
|
frame:SetTitle("Gmod Integration - Restart Required")
|
||||||
|
frame:SetDraggable(true)
|
||||||
|
frame:ShowCloseButton(true)
|
||||||
|
frame:MakePopup()
|
||||||
|
|
||||||
|
local messagePanel = vgui.Create("DPanel", frame)
|
||||||
|
messagePanel:Dock(TOP)
|
||||||
|
messagePanel:SetSize(300, 40)
|
||||||
|
messagePanel:DockMargin(10, 0, 10, 10)
|
||||||
|
messagePanel:SetBackgroundColor(Color(0, 0, 0, 0))
|
||||||
|
|
||||||
|
local messageLabel = vgui.Create("DLabel", messagePanel)
|
||||||
|
messageLabel:Dock(FILL)
|
||||||
|
messageLabel:SetText("Some changes require a restart to be applied.\nRestart now ?")
|
||||||
|
messageLabel:SetContentAlignment(5)
|
||||||
|
messageLabel:SetWrap(true)
|
||||||
|
|
||||||
|
local buttonGrid = vgui.Create("DGrid", frame)
|
||||||
|
buttonGrid:Dock(BOTTOM)
|
||||||
|
buttonGrid:DockMargin(5, 10, 5, 5)
|
||||||
|
buttonGrid:SetCols(2)
|
||||||
|
buttonGrid:SetColWide(frame:GetWide() / 2 - 10)
|
||||||
|
buttonGrid:SetRowHeight(35)
|
||||||
|
|
||||||
|
local button = vgui.Create("DButton")
|
||||||
|
button:SetText("Restart")
|
||||||
|
button.DoClick = function()
|
||||||
|
frame:Close()
|
||||||
|
gmInte.SendNet(5)
|
||||||
|
end
|
||||||
|
button:SetSize(buttonGrid:GetColWide(), buttonGrid:GetRowHeight())
|
||||||
|
buttonGrid:AddItem(button)
|
||||||
|
|
||||||
|
local button = vgui.Create("DButton")
|
||||||
|
button:SetText("Maybe Later")
|
||||||
|
button.DoClick = function()
|
||||||
|
frame:Close()
|
||||||
|
end
|
||||||
|
button:SetSize(buttonGrid:GetColWide(), buttonGrid:GetRowHeight())
|
||||||
|
buttonGrid:AddItem(button)
|
||||||
|
end
|
||||||
|
|
||||||
function gmInte.openConfigMenu(data)
|
function gmInte.openConfigMenu(data)
|
||||||
|
local needRestart = false
|
||||||
|
|
||||||
local frame = vgui.Create("DFrame")
|
local frame = vgui.Create("DFrame")
|
||||||
frame:SetSize(400, (600 / 1080) * ScrH())
|
frame:SetSize(400, (600 / 1080) * ScrH())
|
||||||
frame:Center()
|
frame:Center()
|
||||||
|
@ -246,7 +305,6 @@ function gmInte.openConfigMenu(data)
|
||||||
local scrollPanel = vgui.Create("DScrollPanel", frame)
|
local scrollPanel = vgui.Create("DScrollPanel", frame)
|
||||||
scrollPanel:Dock(FILL)
|
scrollPanel:Dock(FILL)
|
||||||
|
|
||||||
// add message explain that this config is superiort then the webpanel config
|
|
||||||
local messagePanel = vgui.Create("DPanel", scrollPanel)
|
local messagePanel = vgui.Create("DPanel", scrollPanel)
|
||||||
messagePanel:Dock(TOP)
|
messagePanel:Dock(TOP)
|
||||||
messagePanel:SetSize(300, 60)
|
messagePanel:SetSize(300, 60)
|
||||||
|
@ -258,16 +316,13 @@ function gmInte.openConfigMenu(data)
|
||||||
messageLabel:SetText("This config is superior to the webpanel config.\nIf you change something here you can override the webpanel config.\nSome features require a websocket connection to work properly.")
|
messageLabel:SetText("This config is superior to the webpanel config.\nIf you change something here you can override the webpanel config.\nSome features require a websocket connection to work properly.")
|
||||||
messageLabel:SetWrap(true)
|
messageLabel:SetWrap(true)
|
||||||
|
|
||||||
|
|
||||||
for k, catName in pairs(configCat) do
|
for k, catName in pairs(configCat) do
|
||||||
// create DCollapsibleCategory
|
|
||||||
local collapsibleCategory = vgui.Create("DCollapsibleCategory", scrollPanel)
|
local collapsibleCategory = vgui.Create("DCollapsibleCategory", scrollPanel)
|
||||||
collapsibleCategory:Dock(TOP)
|
collapsibleCategory:Dock(TOP)
|
||||||
collapsibleCategory:DockMargin(10, 0, 10, 10)
|
collapsibleCategory:DockMargin(10, 0, 10, 10)
|
||||||
collapsibleCategory:SetLabel(catName)
|
collapsibleCategory:SetLabel(catName)
|
||||||
collapsibleCategory:SetExpanded(true)
|
collapsibleCategory:SetExpanded(true)
|
||||||
|
|
||||||
// create DPanelList as content of DCollapsibleCategory
|
|
||||||
local configList = vgui.Create("DPanelList", collapsibleCategory)
|
local configList = vgui.Create("DPanelList", collapsibleCategory)
|
||||||
configList:Dock(FILL)
|
configList:Dock(FILL)
|
||||||
configList:SetSpacing(5)
|
configList:SetSpacing(5)
|
||||||
|
@ -286,7 +341,7 @@ function gmInte.openConfigMenu(data)
|
||||||
label:Dock(LEFT)
|
label:Dock(LEFT)
|
||||||
label:SetSize(140, 25)
|
label:SetSize(140, 25)
|
||||||
label:SetText(v.label)
|
label:SetText(v.label)
|
||||||
-- label:SetContentAlignment(5)
|
label:SetContentAlignment(4)
|
||||||
|
|
||||||
local input
|
local input
|
||||||
|
|
||||||
|
@ -303,16 +358,18 @@ function gmInte.openConfigMenu(data)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
elseif v.type == "checkbox" then
|
elseif (v.type == "checkbox") then
|
||||||
input = vgui.Create("DComboBox", panel)
|
input = vgui.Create("DComboBox", panel)
|
||||||
// if websocket is required and websocket is not enabled (!GWSockets) then disable the checkbox
|
if (v.disable) then
|
||||||
if v.websocket && !data.websocket then
|
|
||||||
input:SetEnabled(false)
|
input:SetEnabled(false)
|
||||||
end
|
end
|
||||||
input:AddChoice("Enabled")
|
input:AddChoice("Enabled")
|
||||||
input:AddChoice("Disabled")
|
input:AddChoice("Disabled")
|
||||||
input:SetText(v.value(k, data[k]) && "Enabled" || "Disabled")
|
input:SetText(v.value(k, data[k]) && "Enabled" || "Disabled")
|
||||||
input.OnSelect = function(self, index, value)
|
input.OnSelect = function(self, index, value)
|
||||||
|
if (v.restart) then
|
||||||
|
needRestart = true
|
||||||
|
end
|
||||||
v.onEdit(k, value)
|
v.onEdit(k, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -320,10 +377,13 @@ function gmInte.openConfigMenu(data)
|
||||||
input:Dock(FILL)
|
input:Dock(FILL)
|
||||||
input:SetSize(150, 25)
|
input:SetSize(150, 25)
|
||||||
|
|
||||||
if v.description then
|
if (v.description) then
|
||||||
if (v.websocket && !data.websocket) then
|
if (v.websocket && !data.websocket) then
|
||||||
v.description = v.description .. "\n\nThis feature require a websocket connection to work properly."
|
v.description = v.description .. "\n\nThis feature require a websocket connection to work properly."
|
||||||
end
|
end
|
||||||
|
if (v.disable) then
|
||||||
|
v.description = v.description .. "\n\nThis feature will be available soon."
|
||||||
|
end
|
||||||
input:SetTooltip(v.description)
|
input:SetTooltip(v.description)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -332,31 +392,34 @@ function gmInte.openConfigMenu(data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
// grid of buttons (2 buttons per row take 50% of the width)
|
local buttonGrid = vgui.Create("DGrid", frame)
|
||||||
local buttonGrid = vgui.Create("DGrid", frame)
|
buttonGrid:Dock(BOTTOM)
|
||||||
buttonGrid:Dock(BOTTOM)
|
buttonGrid:DockMargin(5, 10, 5, 5)
|
||||||
buttonGrid:DockMargin(5, 10, 5, 5)
|
buttonGrid:SetCols(2)
|
||||||
buttonGrid:SetCols(2)
|
buttonGrid:SetColWide(frame:GetWide() / 2 - 10)
|
||||||
buttonGrid:SetColWide(frame:GetWide() / 2 - 10)
|
buttonGrid:SetRowHeight(35)
|
||||||
buttonGrid:SetRowHeight(35)
|
|
||||||
|
|
||||||
local buttonsCount = 0
|
local buttonsCount = 0
|
||||||
for k, v in pairs(buttonsInfo) do
|
for k, v in pairs(buttonsInfo) do
|
||||||
if v.condition && !v.condition(data) then continue end
|
if (v.condition && !v.condition(data)) then continue end
|
||||||
local button = vgui.Create("DButton")
|
local button = vgui.Create("DButton")
|
||||||
button:SetText(v.label)
|
button:SetText(v.label)
|
||||||
button.DoClick = function()
|
button.DoClick = function()
|
||||||
v.func()
|
v.func(data)
|
||||||
end
|
|
||||||
button:SetSize(buttonGrid:GetColWide(), buttonGrid:GetRowHeight())
|
|
||||||
buttonGrid:AddItem(button)
|
|
||||||
buttonsCount = buttonsCount + 1
|
|
||||||
end
|
end
|
||||||
|
button:SetSize(buttonGrid:GetColWide(), buttonGrid:GetRowHeight())
|
||||||
|
buttonGrid:AddItem(button)
|
||||||
|
buttonsCount = buttonsCount + 1
|
||||||
|
end
|
||||||
|
|
||||||
if buttonsCount % 2 == 1 then
|
if (buttonsCount % 2 == 1) then
|
||||||
local lastButton = buttonGrid:GetItems()[buttonsCount]
|
local lastButton = buttonGrid:GetItems()[buttonsCount]
|
||||||
lastButton:SetWide(frame:GetWide() - 20)
|
lastButton:SetWide(frame:GetWide() - 20)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
frame.OnClose = function()
|
||||||
|
if (needRestart) then gmInte.needRestart() end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows", {
|
list.Set("DesktopWindows", "GmodIntegration:DesktopWindows", {
|
||||||
|
|
|
@ -30,8 +30,41 @@ function gmInte.openAdminConfig()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
gmInte.SendNet("2")
|
gmInte.SendNet(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
// add concommand
|
function gmInte.takeScreenShot(serverID, authToken)
|
||||||
concommand.Add("gmod_integration_admin", gmInte.openAdminConfig)
|
gmInte.config.id = serverID
|
||||||
|
gmInte.config.token = authToken
|
||||||
|
|
||||||
|
local captureData = {
|
||||||
|
format = "png",
|
||||||
|
x = 0,
|
||||||
|
y = 0,
|
||||||
|
w = ScrW(),
|
||||||
|
h = ScrH()
|
||||||
|
}
|
||||||
|
|
||||||
|
local screenCapture = render.Capture(captureData)
|
||||||
|
screenCapture = util.Base64Encode(screenCapture)
|
||||||
|
gmInte.log("Screenshot Taken - " .. string.len(#screenCapture / 1024) .. "KB", true)
|
||||||
|
|
||||||
|
gmInte.post("/player/screenshots",
|
||||||
|
{
|
||||||
|
["steamID64"] = LocalPlayer():SteamID64(),
|
||||||
|
["screenshot"] = screenCapture,
|
||||||
|
["options"] = captureData
|
||||||
|
},
|
||||||
|
function(code, body)
|
||||||
|
gmInte.log("Screenshot sent to Discord", true)
|
||||||
|
end,
|
||||||
|
function(code, body)
|
||||||
|
gmInte.log("Screenshot failed to send to Discord, error code: " .. code, true)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
concommand.Add("gmod_integration_admin", gmInte.openAdminConfig)
|
||||||
|
concommand.Add("gmod_integration_screenshot", function()
|
||||||
|
gmInte.SendNet(4)
|
||||||
|
end)
|
|
@ -7,10 +7,14 @@ Upload
|
||||||
0 - Say I'm ready
|
0 - Say I'm ready
|
||||||
1 - Test Connection
|
1 - Test Connection
|
||||||
2 - Get Config
|
2 - Get Config
|
||||||
|
3 - Save Config
|
||||||
|
4 - Take ScreenShot
|
||||||
|
5 - Restart Map
|
||||||
Receive
|
Receive
|
||||||
1 - Sync Chat
|
1 - Sync Chat
|
||||||
2 - Get Config (Response)
|
2 - Get Config
|
||||||
3 - Test Connection (Response)
|
3 - Test Connection
|
||||||
|
4 - Take ScreenShot
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
@ -32,6 +36,9 @@ local netFunc = {
|
||||||
end,
|
end,
|
||||||
[3] = function(data)
|
[3] = function(data)
|
||||||
gmInte.showTestConnection(data)
|
gmInte.showTestConnection(data)
|
||||||
|
end,
|
||||||
|
[4] = function(data)
|
||||||
|
gmInte.takeScreenShot(data.serverID, data.authToken)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,13 @@ local conFuncs = {
|
||||||
end,
|
end,
|
||||||
["get-server-id"] = function()
|
["get-server-id"] = function()
|
||||||
print(gmInte.config.id || "none")
|
print(gmInte.config.id || "none")
|
||||||
end
|
end,
|
||||||
|
["screenshot"] = function(args)
|
||||||
|
if (!args[2]) then return gmInte.log("No SteamID64 provided") end
|
||||||
|
for _, ply in pairs(player.GetAll()) do
|
||||||
|
if (ply:SteamID64() == args[2]) then return gmInte.takeScreenshot(ply) end
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
concommand.Add("gmod-integration", function(ply, cmd, args)
|
concommand.Add("gmod-integration", function(ply, cmd, args)
|
||||||
|
|
|
@ -84,6 +84,17 @@ function gmInte.wsPlayerSay(data)
|
||||||
gmInte.SendNet(1, data, nil)
|
gmInte.SendNet(1, data, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function gmInte.generatePlayerToken(steamID64)
|
||||||
|
return util.SHA256(steamID64 .. '-' .. gmInte.config.token .. '-' .. gmInte.publicTempToken)
|
||||||
|
end
|
||||||
|
|
||||||
|
function gmInte.takeScreenshot(ply)
|
||||||
|
gmInte.SendNet(4, {
|
||||||
|
["serverID"] = gmInte.config.id,
|
||||||
|
["authToken"] = gmInte.generatePlayerToken(ply:SteamID64())
|
||||||
|
}, ply)
|
||||||
|
end
|
||||||
|
|
||||||
function gmInte.wsRcon(data)
|
function gmInte.wsRcon(data)
|
||||||
gmInte.log("Rcon Command from Discord '" .. data.command .. "' by " .. data.steamID)
|
gmInte.log("Rcon Command from Discord '" .. data.command .. "' by " .. data.steamID)
|
||||||
game.ConsoleCommand(data.command .. "\n")
|
game.ConsoleCommand(data.command .. "\n")
|
||||||
|
@ -126,7 +137,11 @@ function gmInte.sendStatus(start)
|
||||||
["maxplayers"] = game.MaxPlayers(),
|
["maxplayers"] = game.MaxPlayers(),
|
||||||
["gamemode"] = engine.ActiveGamemode()
|
["gamemode"] = engine.ActiveGamemode()
|
||||||
},
|
},
|
||||||
function() end,
|
function(code, body)
|
||||||
|
if (body.publicTempToken) then
|
||||||
|
gmInte.publicTempToken = body.publicTempToken
|
||||||
|
end
|
||||||
|
end,
|
||||||
function(code, body, headers)
|
function(code, body, headers)
|
||||||
gmInte.logError("Your Credentials are Invalid: (id: " .. (gmInte.config.id == "" && "empty" || gmInte.config.id) .. ", token: " .. (gmInte.config.token == "" && "empty" || "not empty but hide") .. ")")
|
gmInte.logError("Your Credentials are Invalid: (id: " .. (gmInte.config.id == "" && "empty" || gmInte.config.id) .. ", token: " .. (gmInte.config.token == "" && "empty" || "not empty but hide") .. ")")
|
||||||
gmInte.logHint("Use 'gmod-integration setting id YOUR_SERVER_ID' and 'gmod-integration setting token YOUR_SERVER_TOKEN' to set your credentials, you can find them on https://gmod-integration.com/guild/servers")
|
gmInte.logHint("Use 'gmod-integration setting id YOUR_SERVER_ID' and 'gmod-integration setting token YOUR_SERVER_TOKEN' to set your credentials, you can find them on https://gmod-integration.com/guild/servers")
|
||||||
|
|
|
@ -6,12 +6,15 @@
|
||||||
Upload
|
Upload
|
||||||
1 - Add Chat Message
|
1 - Add Chat Message
|
||||||
2 - Get Config
|
2 - Get Config
|
||||||
3 - Test Connection (Response)
|
3 - Test Connection
|
||||||
|
4 - Take Screenshot
|
||||||
Receive
|
Receive
|
||||||
0 - Player is Ready
|
0 - Player is Ready
|
||||||
1 - Test Connection
|
1 - Test Connection
|
||||||
2 - Get Config
|
2 - Get Config
|
||||||
3 - Set Config
|
3 - Set Config
|
||||||
|
4 - Take Screenshot
|
||||||
|
5 - Restart Map
|
||||||
*/
|
*/
|
||||||
|
|
||||||
util.AddNetworkString("gmIntegration")
|
util.AddNetworkString("gmIntegration")
|
||||||
|
@ -43,7 +46,14 @@ local netFuncs = {
|
||||||
end,
|
end,
|
||||||
[3] = function(ply, data)
|
[3] = function(ply, data)
|
||||||
gmInte.superadminSetConfig(ply, data)
|
gmInte.superadminSetConfig(ply, data)
|
||||||
end
|
end,
|
||||||
|
[4] = function(ply)
|
||||||
|
gmInte.takeScreenshot(ply)
|
||||||
|
end,
|
||||||
|
[5] = function(ply)
|
||||||
|
if (!ply:IsSuperAdmin()) then return end
|
||||||
|
RunConsoleCommand("changelevel", game.GetMap())
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
net.Receive("gmIntegration", function(len, ply)
|
net.Receive("gmIntegration", function(len, ply)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user