How can I tell if the player has x game?

Hey. I need to tell if the player has a certain gamemode (For this, I need to check if the player has TF2). Any clues as to how I would do this? Thanks.

May I ask why you need to find out what games a player has?

And even so, i don’t think there is a way.

Because I’m using a TF2 model as my entity, and for people without TF2 it becomes an error. I just want to prevent this by checking if they have it, and if not - I can change the model to a different one.

I’m not sure you can check if a player has a certain game :confused:

You could just use a custom model as an entity, then it would be appropriate to use the ResourceAddFile command.

We need no custom model. The TF2 model suits my needs fine.

Yeah, but if people do not have TF2, then it is better to use a custom model, and then force clients to download it, instead of seeing errors.

I would rather just get a way to check if TF2 is mounted or something.

Perhaps, not sure, you could use **[File.Find

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=File.Find)** to check if the player has got the models you need?

Doesn’t that check only the Gmod Directory?

That only checks GMod directory.

Ninjad.

How about you default it to either the tf2 model or a custom model and allow the client to change it using a console command ?

isnt there a GetMountedContent function or something?

I think thats only for use with the server.

**[G.GetMountedContent

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.GetMountedContent)**

its shared

[editline]06:36PM[/editline]

Or:
**[Util.IsValidModel

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Util.IsValidModel)**

Wow, for some reason i’ve had a sudden surge of learning more coding, and have gotten much further with my gamemode.

ONTOPIC: Listen to Tobba

If that doesn’t work, you could always convert their steamid to their community id, http.Get the steam community website in xml mode and check there.

But with private profiles that wont work?

You want to display a different model clientside for players that don’t have tf2? If it’s a prop with physics it could easilly look very weird.

I’m pretty sure Steam returns gameinfo for private profiles too.

[editline]07:12PM[/editline]

Or not.

http://steamcommunity.com/id/--YouLostTheGame/games/?tab=all/&xml=1

Thanks guys. You have been a great help.