Jump to content

Obtaining client OS


Recommended Posts

Posted

Hello!

I've just seen the news of MTA dropping XP and Vista, in what I guess, will be the next version of the client. I was wondering if there's any way to obtain the operating system of an user, so I could specifically notify them ingame, and also collect data of how many of my userbase will be affected by this change.

Thanks in advance!

Posted

I'm afraid that the function you mention does not suit this case, it only shows if it is Windows or macOS, not the version of the OS:

Executing client-side command: inspect( getVersion() )
Command results: {
  mta = "1.5.6",
  name = "MTA:SA Client",
  number = 342,
  os = "Windows",
  sortable = "1.5.6-9.16588.5",
  tag = "1.5.6-release-16588",
  type = "Release"
} [string]

 

Posted (edited)

Why would you need the OS Version number ? I mean you could work with country / regions or even by MTA version number which should be more than enough for your use case

Edited by Luxy.c
Posted

How can I know who's using XP or Vista with that information? What I want to obtain is the users who are going to get "discontinued" in the next months. I don't see how region or MTA version number can help me to obtain that info.
 

Thanks for your answer!

 

Posted (edited)

Well since XP and Vista users are running a separate branch of MTA, their version would probably contain something along xp-vista in version information.

Edited by John Smith
  • Scripting Moderators
Posted

I see two options:
1) Use CEF and parse the user-agent setting (as the legacy build uses a certain version).
2) Parse the XP/Vista build numbers from https://nightly.multitheftauto.com/ and compare with the client version.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...