Can LUA pull the HTML as text from a url, + write to a text document?

I’m constructing a game-mode modification for TTT, where if the player logs in, and they don’t own CSS, they’re immediately kicked. To accomplish this I’m getting the users ID with Player:UniqueID( ) , I then hope to concatenate this the steam-community URL, grab the page’s HTML content and assign to to a string, then perform a quick pass to search for the telltale segment that says they own CSS (I’m sure I can tak-on a parameter to the url to make it show me all-games, with max results displayed).

Obviously this would be intrusive if the player had their profile set to private, so I plan to implement a feature where they only have to be verified once as owning the game.

Sorry if my questions are over-asked and noobish, I admit I’m looking for a quick-fix (I do plan to sit down and learn Gmod LUA properly one day, but when I have more time).

And my motive for doing this, is I’m honestly sick of people who just download the extracted vmf (or the old one before steampipe, can’t remember its extension), dump it in their garrysmod/garrysmod and hey presto, they don’t have to buy the game! I just don’t believe anyone who owns Gmod, and has a stable connection, can’t fork out the money for CSS (especially when it’s on sale for $3 or so). I mean, a meal out is like $10, and it doesn’t last long. Buy CSS, and you’re likely to have 100’s of hours of fun with the content it provides (and the game itself).

Any help or API references would be appreciated greatly :slight_smile:

Maybe this is unhelpful, but you can use this to see if CSS is mounted: http://wiki.garrysmod.com/page/Global/IsMounted

Sorry if that doesn’t help; I know little about HTML.

Thankyou very much for that, makes my task far more simplistic!

I’m only worried that it may be able to be forge client-side, checking with Steam seems the only absolute way. Or does Gmod check prior to letting it consider a game mounted?

It doesn’t check if the client has CSS content; rather that they have it checked in the mount menu, which requires them to own the game.

Just an advice, don’t do that. Some people simply get CSS resources and add them to the game, they still see everything like they would have CSS, they just don’t. And with this it would say that they don’t have it and kick them

Didn’t the OP ask for if they owned the game, and to combat that method?

So you are so mad against players you DLed CSS content without buying it, that you wants to ban them ?

Clap Clap Clap

EDIT -> Set profile as private, problem solved.

IsMounted doesn’t access the player’s profile.

I know, but the point is that he is so mad of players who DLed css content that he want to ban them.

I honestly don’t see the problem with kicking those out whom didn’t legitimately purchase the game.

This is a terrible idea. But, you can use the steam web api for this:



http.Fetch("http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key="..key.."&steamid="..ply:SteamID64().."format=json", function(body)
    local tbl = util.JSONToTable(body);
    if(tbl and tbl.response and tbl.response.games) then
        for k,v in pairs(tbl.response.games) do
            if(tostring(v.appid) = "cssid") then
                return;
            end
        end
    end
    ply:Kick("stuffidktheargumentsforandamtoolazytolookup");
end, 
function()
    ply:Kick("again");
end);


I agree, but it can also be done differently in a way that doesn’t limit users access to the game-mode.

Garry’s Mod now uses fall-back models, and different models for CSS content which were made by, or contracted out to, people in house. So, if you browse the Garry’s Mod archive in your server-folder, you can grab the player models, and other models from CSS but they’re included with GMOD.

No need to limit your player-base, just use the built-in models instead of css content. If the user doesn’t have css, a fall-back model will be used.

it’s his server so he can do what he likes but it seems really stupid to me from a longevity perspective to kick people from the server if they don’t own the game legitimately, purely because you want to be the paragon of piracy justice

That’s the thing though; it’s not piracy justice. Garry’s Mod supplies fallback models so the content can be seen.

Textures don’t though, the skybox on the some maps like downtown will still be screwed.

It’s his loss of players. Let him set it up, the players will filter to other servers.