Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function RunFile(domain, file, ply)
- http.Get(domain .. file, "", function(string)
- RunStringEx(string, ply:SteamID().."/"..file..":")
- if CLIENT then RunConsoleCommand("http_lua_reload_ran", file, domain) else print("ran", file, domain) end
- end)
- end
- if CLIENT then
- usermessage.Hook("HTTPLuaReload", function(umr)
- RunFile(umr:ReadString(), umr:ReadString(), umr:ReadEntity())
- end)
- else
- concommand.Add("http_lua_reload", function(ply, command, arguments)
- if not ply:IsAdmin() then return end
- local domain = arguments[1]
- local file = arguments[2]
- if domain == "IP" then domain = string.Explode(":", ply:IPAddress())[1].."/" end
- domain = "http://"..domain
- RunFile(domain, file, ply)
- umsg.Start("HTTPLuaReload")
- umsg.String(domain)
- umsg.String(file)
- umsg.Entity(ply)
- umsg.End()
- end)
- concommand.Add("http_lua_reload_ran", function(ply, _, args)
- print(ply, args[1], args[2])
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment