AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Determine a Client's OS (https://forums.alliedmods.net/showthread.php?t=218691)

GoD-Tony 06-19-2013 14:16

Determine a Client's OS
 
2 Attachment(s)
By using QueryClientConVar and checking if these unique convars exist on a client, you can determine which operating system the client is running. Useful for building statistics and other creative ideas.
  • Windows - "windows_speaker_config"
  • Linux - "sdl_double_click_size"
  • Mac - "gl_can_mix_shader_gammas"
See the attached gamedata for the latest cvars known to work. Edit: Dr.Mckay's updated gamedata can be found here.

I've attached an example that I was playing around with. Thanks to psychonic for providing a Mac cvarlist to work with.

API 06-19-2013 14:21

Re: Determine a Client's OS
 
Really cool! I'll be using this!

Peace-Maker 06-19-2013 17:01

Re: Determine a Client's OS
 
That's far nicer than using javascript in a motd! Thank you!

mcpan313 06-19-2013 21:41

Re: Determine a Client's OS
 
Nice job, very useful! :)

BAILOPAN 06-19-2013 23:58

Re: Determine a Client's OS
 
Why are people doing OS-specific stuff in SourcePawn? Are you insane?

API 06-20-2013 00:44

Re: Determine a Client's OS
 
It's really just for fun in my case :) Printing a message to clients about percentage of players which use Mac.

GoD-Tony 06-20-2013 01:35

Re: Determine a Client's OS
 
Quote:

Originally Posted by BAILOPAN (Post 1973465)
Why are people doing OS-specific stuff in SourcePawn? Are you insane?

It's about determining the OS of the clients connected to the server, presumably to be used for trivial plugin features. Something like OS-specific usermessages isn't what we're after.

BAILOPAN 06-20-2013 01:53

Re: Determine a Client's OS
 
Oh god what kind of plugin features

Zephyrus 06-20-2013 03:28

Re: Determine a Client's OS
 
banning macosx ppl for example and rewarding linux players

napalm00 06-20-2013 03:58

Re: Determine a Client's OS
 
Quote:

Originally Posted by Zephyrus (Post 1973538)
banning macosx ppl for example and rewarding linux players

lool :bacon!:


All times are GMT -4. The time now is 23:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.