I thought this would work, replacing the prints with commands, didnt work...
Original:
function CommunityCheckStatus( communityID, ply )
if not IsValid(ply) then return end
local id = util.SteamIDTo64( ply:SteamID() )
http.Fetch( "http://steamcommunity.com/groups/sandboxwars" .. 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/sandboxwars" .. 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
Modified:
function CommunityCheckStatus( communityID, ply )
if not IsValid(ply) then return end
local id = util.SteamIDTo64( ply:SteamID() )
http.Fetch( "http://steamcommunity.com/groups/sandboxwars" .. 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/sandboxwars" .. 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
RunConsoleCommand("ulx", "adduser", ply:SteamID(), "member")
end
function SetPlayerMemberID( id )
RunConsoleCommand("ulx", "adduser", ply:SteamID(), "member")
end