kizaru335

Anti-Hacker

Aug 23rd, 2017
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. local UseApi = CreateConVar( 'sv_useapi', 0 )
  2. local APIKey = CreateConVar( 'sv_apikey', '0', FCVAR_PROTECTED, 'apikey for anti-man' ) --https://steamcommunity.com/dev/apikey
  3.  
  4. local function HandleAltAccount( c, SteamIDAlt, SteamIDMain )
  5.  
  6. if SteamIDMain == 'STEAM_0:0:135734974' then
  7. timer.Simple( 5, function()
  8. if IsValid(c) then
  9. ulx.ban( 0, true, 'poshel von' )
  10.  
  11. function ulx.ban( calling_ply, target_ply, minutes, reason )
  12. if target_ply:IsBot() then
  13. ULib.ban( calling_ply, "Banned", true )
  14. return
  15. end
  16.  
  17. if math.floor( tonumber( UseApi:GetString() ) ) == 1 then
  18. http.Fetch( string.format( "http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=%s&format=json&steamid=%s&appid_playing=4000", APIKey:GetString(), c:SteamID64() ), function( body )
  19. if !IsValid(c) then return end
  20.  
  21. body = util.JSONToTable( body )
  22.  
  23. if (not body) or (not body.response) or (not body.response.lender_steamid) then
  24. error( string.format( "FamilySharing: Invalid Steam API response for %s | %s\n", name, SteamID ) )
  25. end
  26. if lender ~= "0" then
  27. HandleAltAccount( c, SteamID, util.SteamIDFrom64( body.response.lender_steamid ) )
  28. end
  29. end, function( code )
  30. error( string.format( "FamilySharing: Failed API call for %s | %s ( Error: %s )\n", name, SteamID, code ) )
  31. end
  32.  
  33. hook.Add( "PlayerInitialSpawn", "CheckFamilySharing", function( c )
  34. local SteamID = c:SteamID()
  35.  
  36. if SteamID == 'STEAM_0:0:0000000' then --write is steamid
  37. timer.Simple( 5, function()
  38. if IsValid(c) then
  39. c:Ban( 0, true, 'Fuck you' )
  40. end
  41. end)
  42. return
  43. end
Advertisement
Add Comment
Please, Sign In to add comment