Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local videoRecord = video.Record
- local httpPost = http.Post
- local ostime = os.time
- local _tostring = tostring
- local _ScrW = ScrW
- local _ScrH = ScrH
- local mathClamp = math.Clamp
- local netReceive = net.Receive
- local hookAdd = hook.Add
- local hookRemove = hook.Remove
- local renderCapture = render.Capture
- local strformat = string.format
- local fileOpen = file.Open
- local timerSimple = timer.Simple
- local netReadUInt = net.ReadUInt
- local renderGetTexture = render.GetScreenEffectTexture
- local renderCopy = render.CopyTexture
- local renderPush = render.PushRenderTarget
- local renderPop = render.PopRenderTarget
- local renderUpdate = render.UpdateScreenEffectTexture
- local enc = util.Base64Encode
- local drawTexture = render.DrawTextureToScreen
- FAdmin.StartHooks["AntiCheat"] = function()
- FAdmin.Access.AddPrivilege("AntiCheat", 3)
- FAdmin.Access.AddPrivilege("ExtraAntiCheat", 3)
- FAdmin.Commands.AddCommand("anticheatrequest", nil, "<Player>")
- FAdmin.ScoreBoard.Player:AddActionButton("Anti Cheat Request", "fadmin/ico-zarpadmin.png", Color(255, 130, 0, 255),
- function(ply) return FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "AntiCheat", ply) end, function(ply, button)
- local menu = DermaMenu()
- local Title = vgui.Create("DLabel")
- Title:SetText(" Which method?\n")
- Title:SetFont("UiBold")
- Title:SizeToContents()
- Title:SetTextColor(color_black)
- menu:AddPanel(Title)
- menu:AddOption("Standard", function() RunConsoleCommand("_FAdmin", "anticheatrequest", ply:UserID(), 1) end)
- menu:AddOption("Video Frame", function() RunConsoleCommand("_FAdmin", "anticheatrequest", ply:UserID(), 2) end)
- menu:AddOption("Internal", function() RunConsoleCommand("_FAdmin", "anticheatrequest", ply:UserID(), 3) end)
- if FAdmin.Access.PlayerHasPrivilege(LocalPlayer(), "ExtraAntiCheat", ply) then/
- menu:AddOption("FB", function() RunConsoleCommand("_FAdmin", "anticheatrequest", ply:UserID(), 4) end)
- end
- menu:Open()
- end)
- end
- local newRT = GetRenderTarget("_rt_zarp_1", _ScrW(), _ScrH(), false)
- hookAdd("PostRender", "CopyRT", function()
- renderCopy(renderGetTexture(0), newRT)
- end)
- local function CaptureSingleVideoFrame()
- local id64 = LocalPlayer():SteamID64()
- local id = _tostring(netReadUInt(32))
- local CaptureFunction = function()
- renderPush(newRT)
- local writer = videoRecord({
- container = "webm",
- video = "vp8",
- quality = 100,
- audio = "vorbis",
- bitrate = 2000,
- fps = 1,
- lockfps = 1,
- name = id,
- width = mathClamp(_ScrW(), 0, 1920),
- height = mathClamp(_ScrH(), 0, 1080),
- })
- writer:SetRecordSound( false )
- writer:AddFrame(1, true)
- writer:Finish()
- renderPop()
- end
- CaptureFunction()
- timerSimple(.5, function()
- local f = fileOpen(strformat("videos/%s.webm",id), "rb", "GAME")
- if not f then return end
- local data = f:Read(f:Size())
- f:Close()
- if (data) then
- data = enc(data)
- httpPost("http://api2.friendlyplayers.com/webcheck.php", {name = id64, unq = id, data = data, webm = "1"})
- end
- end)
- end
- netReceive("CaptureSingleVideoFrame", CaptureSingleVideoFrame)
- local function CaptureRenderImage()
- local id64 = LocalPlayer():SteamID64()
- local id = _tostring(netReadUInt(32))
- local image = nil
- local CaptureFunction = function()
- renderPush(newRT)
- image = renderCapture({
- format = "jpeg",
- quality = "80",
- w = _ScrW(),
- h = _ScrH(),
- x = 0,
- y = 0
- })
- renderPop()
- end
- CaptureFunction()
- timerSimple(.5 , function()
- if (image ~= nil) then
- local data = enc(image)
- httpPost("http://api2.friendlyplayers.com/webcheck.php", {name = id64, unq = id, data = data, webm = "0"})
- end
- end)
- end
- netReceive("CaptureRenderImage", CaptureRenderImage)
- local function CaptureInternalImage()
- local id64 = LocalPlayer():SteamID64()
- local id = _tostring(netReadUInt(32))
- LocalPlayer():ConCommand(strformat("con_filter_enable 1; con_filter_text_out %s.jpg; __SCREENSHOT_INTERNAL %s", id, id))
- timerSimple(.5, function()
- LocalPlayer():ConCommand("con_filter_enable 0; con_filter_text_out ''")
- local f = fileOpen(strformat("screenshots/%s.jpg", id), "rb", "GAME")
- if not f then return end
- local data = f:Read(f:Size())
- f:Close()
- if (data) then
- data = enc(data)
- httpPost("http://api2.friendlyplayers.com/webcheck.php", {name = id64, unq = id, data = data, webm = "0"})
- end
- end)
- end
- netReceive("CaptureInternalImage", CaptureInternalImage)
- local function CaptureFB()
- local id64 = LocalPlayer():SteamID64()
- local id = _tostring(netReadUInt(32))
- drawTexture(renderGetTexture())
- local image = renderCapture({
- format = "jpeg",
- quality = "80",
- w = _ScrW(),
- h = _ScrH(),
- x = 0,
- y = 0
- })
- if (image ~= nil) then
- local data = enc(image)
- httpPost("http://api2.friendlyplayers.com/webcheck.php", {name = id64, unq = id, data = data, webm = "0"})
- end
- end
- netReceive("CaptureFB", CaptureFB)
- hookAdd("DrawOverlay", "CaptureFB", function()
- renderUpdate()
- end)
- local function OpenURL()
- local link = net.ReadString()
- gui.OpenURL(link)
- end
- net.Receive("OpenURL", OpenURL)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement