Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: dvar functions?

  1. #1
    Private
    Join Date
    May 2013
    Posts
    21
    Thanks
    5
    Thanked 2 Times in 2 Posts

    dvar functions?

    Is it possible to check/set/whatever a dvar like, maxfps() instead of getdvar("com_maxfps")?

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You can rename the dvar's with a hex editor like WinHex
    timescale 0.01

  3. #3
    Private
    Join Date
    May 2013
    Posts
    21
    Thanks
    5
    Thanked 2 Times in 2 Posts
    What I mean is, check the actual dvar value and not get the value of example 'com_maxfps'. Because people can change com to con etc. Just wondering if there is a way to check without going through getdvar

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    I thought about a generic way, but there isn't much room for a solution. Though com_maxfps could be detected with a trick:

    Set it to e.g. 2 with player setclientcvar("com_maxfps", "2") and then watch the ping. If ping goes up: test succeeded

    Of course you can't read the ping without any extension, but I rent servers with it: http://killtube.org/forumdisplay.php?37-Hosting

    Alternativly you can use B3 to control the ping, wrote an easy to understand introduction for that: http://killtube.org/showthread.php?1...Command-Adding!
    timescale 0.01

  5. #5
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by omnimouz View Post
    What I mean is, check the actual dvar value and not get the value of example 'com_maxfps'. Because people can change com to con etc. Just wondering if there is a way to check without going through getdvar
    I don't really know what you are talking about because some of the things you've said are not correct. So, talking about dvars in general:

    1. You cannot permanently change the name of a dvar. These are in the engine. The only way to permanently change them is through hacking the executable, or reverse engineering the game back to source, changing what you want, then recompiling. However, you can redefine them in script.

    2. The only way to get the value of a dvar is with getCvar()/getDvar() (depending on which game you are talking about).

    3. You cannot get the value of a dvar for a client, as their is no getClientCvar()/getClientDvar() function in any COD game. Whenever you use getCvar()/getDvar(), it will return the value for the whole server, not for any particular client. The only way to get a the value of a dvar for a particular client is to custom-make the dvar for the client - for example by putting their entity number on the end of it - and when you get it's value, it will be for that client simply because it has an extension which is unique to a particular client.
    Last edited by Tally; 23rd May 2013 at 12:02.

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by omnimouz View Post
    Is it possible to check/set/whatever a dvar like, maxfps() instead of getdvar("com_maxfps")?
    maxFPS() would not be a dvar - it would be a function. You can define your own functions in COD script to replace any built-in COD engine function. For example, this is a redefinition of setCvar():

    PHP Code:
    setCvarDefdvarvalue )
    {
        
    mapname getCvar ("mapname");

        if (
    isdefined (level.gametype))
            
    gametype level.gametype;
        else
            
    gametype getCvar ("g_gametype");

        
    suffixed_dvar dvar "_" gametype "_" mapname;
        
        
    setCvar (suffixed_dvarvalue);

    It extends the range of setCvar() to include checking map names, gametypes names, or both, when setting a dvar.
    Last edited by Tally; 23rd May 2013 at 12:09.

  7. #7
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Quote Originally Posted by Tally View Post
    1. You cannot permanently change the name of a dvar. These are in the engine. The only way to permanently change them is through hacking the executable, or reverse engineering the game back to source, changing what you want, then recompiling. However, you can redefine them in script.
    Just search the name of a cvar with a hex editor and change com_maxfps to lol_maxfps e.g. and it would render some detection methods useless. You dont need to recompile anything. The manipulation of software is called cracking (http://en.wikipedia.org/wiki/Software_cracking).

    To change the fps, the "hacker" would do this to change his fps: set lol_maxfps 125

    Thats how my detection method would work, because this wouldn't affect anything, and that can be detected: player setclientcvar("com_maxfps", "2");

    After the test, which can be done in 1 second e.g. the choosen fps can be set (125, 250 etc.)


    The actual 2-fps-detection could be done with many ways I guess.
    timescale 0.01

  8. #8
    Private
    Join Date
    May 2013
    Posts
    21
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Sorry, tried to post yesterday but site wouldn't let me..

    To change the dvar, all you need to do is edit the .exe as kung foo said, com_maxfps can be changed to lol_maxfps as with all other ones, and then the command com_maxfps with come up with 'external dvar', and wont do anything in the game

    What I was asking if there is a function to change/use/check the value of the max fps without using the dvar, which i guess is impossible or very hard

  9. #9
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    I think you want to limit the maxfps for players (its useful e.g. for a jump mod).
    The easiest way would be make an infinity cycle, where you set a value for the cvar in every frame.

  10. #10
    Private
    Join Date
    May 2013
    Posts
    21
    Thanks
    5
    Thanked 2 Times in 2 Posts
    That can be bypassed by editing the dvar in the .exe though

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •