Tidas

Untitled

Jul 8th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. local PLUGIN = PLUGIN;
  2.  
  3. if(!Clockwork.config:Get("cloudban_url"):Get()) then
  4. Clockwork.config:Get("cloudban_url"):Set("https://dl.dropboxusercontent.com/u/32687773/banned.txt")
  5. end;
  6.  
  7. -- Called when a player spawns.
  8. function PLUGIN:PlayerSpawn(player)
  9. local count = 0
  10. http.Fetch(Clockwork.config:Get("cloudban_url"):Get(),
  11. function(body, len, headers, code)
  12. if(string.find(body, player:SteamID())) then
  13. Clockwork.player:NotifyAll("[CloudBan] "..player:SteamName().." ("..player:SteamID()..") has been permanently banned.")
  14. Clockwork.bans:Add(player:SteamID(), 0, "[CloudBan] You are permanently banned from this server")
  15. else
  16. count = count + 1
  17. if(count == 1) then
  18. Clockwork.kernel:PrintLog(LOGTYPE_MINOR, "[CloudBan] No positive match found for "..player:SteamName().." ("..player:SteamID()..").")
  19. end;
  20. end;
  21. end,
  22. function(code)
  23. ErrorNoHalt("[CloudBan] An error has occurred ("..code.."). Reverting to default ban list.")
  24. http.Fetch("https://dl.dropboxusercontent.com/u/32687773/banned.txt",
  25. function(body, len, headers, code)
  26. if(string.find(body, player:SteamID())) then
  27. Clockwork.player:NotifyAll("[CloudBan] "..player:SteamName().." ("..player:SteamID()..") has been permanently banned.")
  28. Clockwork.bans:Add(player:SteamID(), 0, "[CloudBan] You are permanently banned from this server")
  29. end;
  30. end,
  31. function(code)
  32. ErrorNoHalt("[CloudBan] An error has occurred ("..code..").")
  33. end)
  34. end)
  35. end;
Advertisement
Add Comment
Please, Sign In to add comment