• How can I tell if the player has x game?
    19 replies, posted
  • Avatar of vipersoul
  • 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.
  • Avatar of HeavyMtl123
  • 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.
  • Avatar of vipersoul
  • 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.
  • Avatar of HeavyMtl123
  • I'm not sure you can check if a player has a certain game :/ You could just use a custom model as an entity, then it would be appropriate to use the ResourceAddFile command.
  • Avatar of HeavyMtl123
  • 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.
  • Avatar of TheJjokerR
  • Perhaps, not sure, you could use [b][url=http://wiki.garrysmod.com/?title=File.Find]File.Find [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] to check if the player has got the models you need?
  • Avatar of HeavyMtl123
  • [QUOTE=thejjokerr;21735045]Perhaps, not sure, you could use [B][URL="http://wiki.garrysmod.com/?title=File.Find"]File.Find [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B] to check if the player has got the models you need?[/QUOTE] Doesn't that check only the Gmod Directory?
  • Avatar of Jamie932
  • [QUOTE=thejjokerr;21735045]Perhaps, not sure, you could use [b][url=http://wiki.garrysmod.com/?title=File.Find]File.Find [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] to check if the player has got the models you need?[/QUOTE] That only checks GMod directory. Ninjad.
  • Avatar of sintwins
  • 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 ?
  • Avatar of Jamie932
  • [QUOTE=Tobba;21735589]isnt there a GetMountedContent function or something?[/QUOTE] I think thats only for use with the server.
  • [b][url=http://wiki.garrysmod.com/?title=G.GetMountedContent]G.GetMountedContent [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] its shared [editline]06:36PM[/editline] Or: [b][url=http://wiki.garrysmod.com/?title=Util.IsValidModel]Util.IsValidModel [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
  • Avatar of HeavyMtl123
  • 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
  • Avatar of |FlapJack|
  • 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.
  • [QUOTE=|FlapJack|;21736387]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.[/QUOTE] But with private profiles that wont work?
  • Avatar of Crazy Quebec
  • 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.
  • Avatar of |FlapJack|
  • [QUOTE=Trivkz;21736451]But with private profiles that wont work?[/QUOTE] I'm pretty sure Steam returns gameinfo for private profiles too. [editline]07:12PM[/editline] Or not. [url]http://steamcommunity.com/id/--YouLostTheGame/games/?tab=all/&xml=1[/url]