Here is a little wrapper I wrote that checks either a player or a SteamID to see if they exist inside of Steam Community Group.
This does very little on its own, but you could very easily modify this to do all kinds of things, including basic ULX group authentication for setting players to member... or whatever you want.
function CommunityCheckStatus( communityID, ply )
if not IsValid(ply) then return end
local id = util.SteamIDTo64( ply:SteamID() )
http.Fetch( "http://steamcommunity.com/groups/" .. communityID .. "/memberslistxml/?xml=1?lolwat="..os.time(),
function( body, _, _, _ )
if string.find( body, id ) then
SetPlayerMember( ply )
else
print( "FALSE" )
end
end,
function( error )
print( "Something went terribly wrong!" )
print( error )
end
)
end
function CommunityCheckStatusID( communityID, sid )
local id = util.SteamIDTo64( sid )
http.Fetch( "http://steamcommunity.com/groups/" .. communityID .. "/memberslistxml/?xml=1?lolwat="..os.time(),
function( body, _, _, _ )
if string.find( body, id ) then
SetPlayerMemberID( id )
else
print( "FALSE" )
end
end,
function( error )
print( "Something went terribly wrong!" )
print( error )
end
)
end
function SetPlayerMember( ply )
if not IsValid(ply) then return end
print( "THIS PLAYER IS A MEMBER!")
end
function SetPlayerMemberID( id )
print( "THIS PLAYER IS A MEMBER!")
end