From 1de5f9ac6f038bfed2230cc1272b253794b2f41a Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 10 Jul 2016 17:04:29 -0400 Subject: Initial commit --- gamemode/server/sv_pac.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gamemode/server/sv_pac.lua (limited to 'gamemode/server/sv_pac.lua') diff --git a/gamemode/server/sv_pac.lua b/gamemode/server/sv_pac.lua new file mode 100644 index 0000000..27b2ed9 --- /dev/null +++ b/gamemode/server/sv_pac.lua @@ -0,0 +1,28 @@ +hook.Add("PrePACConfigApply", "donators only", function(ply, outfit_data) + if not ply:IsSuperAdmin() then + return false, "give us money!" + end +end) + +hook.Add( "PrePACEditorOpen", "RestrictToSuperadmin", function( ply ) + if not ply:IsSuperAdmin( ) then + return false + end +end ) + +util.AddNetworkString("requestpac") +util.AddNetworkString("responsepac") + +--be able to stream pac data to clients on-demand +net.Receive("requestpac",function(ln,ply) + local name = net.ReadString() + local pdata = file.Read(string.format("artery/pac/%s.txt",name)) --make sure to have the .txt, so dot-dot-slash attacks can't read the mysql file. + net.Start("responsepac") + net.WriteString(pdata) + net.Send(ply) +end) + +hook.Add("PlayerInitialSpawn", "AllowPacThings",function(ply) + --pac.SetupENT(ply, false) + PrintTable(pac) +end) -- cgit v1.2.3-70-g09d2