.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   What's the best way to detect CS1.6? (http://forums.bots-united.com/showthread.php?t=212)

cruft 05-01-2004 08:19

What's the best way to detect CS1.6?
 
So what's the best way to detect that you're running under CS1.6 (or any version of CS for that matter)? Check existence of certain files? Perhaps a global var somewhere if we're lucky? How are people doing this, if at all, to stay backward compatible with CS1.5?

Pierre-Marie Baty 05-01-2004 09:40

Re: What's the best way to detect CS1.6?
 
Personally I test for the existence of certain files.

Look in the "I'm STEAMed up" thread to see which ones (I can't remember them myself exactly :D)

cruft 06-01-2004 08:34

Re: What's the best way to detect CS1.6?
 
I suppose we can infer or assume CS1.6 if we detect Steam. However, it doesn't really give us any indication what version of CS we're running. I guess that's what I'll have to settle on for now unless there are any more suggestions.

Pierre-Marie Baty 06-01-2004 13:31

Re: What's the best way to detect CS1.6?
 
No, why so ?
One suggestion that would work is to open the liblist.gam file and check for the "version" key/value pair. Another one, would be to check for the mp.dll file size.
There are a lot of things which can be done in order to do this check, just use your imagination :)

Whistler 22-02-2004 09:52

Re: What's the best way to detect CS1.6?
 
This is what I'm using:

Code:

    // see if we are running Counter-Strike v1.6...
    unsigned char *tempbuf;
 
    // only CS v1.6 has this file
    // use HL Engine function so that it would not be affected by Steam...
    tempbuf = LOAD_FILE_FOR_ME("sprites/weapon_famas.txt",NULL);
 
    if (tempbuf)
    {
          g_bIsVersion16 = TRUE;
          FREE_FILE(tempbuf);
    }



All times are GMT +2. The time now is 06:04.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.