Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: COD4 Need help with saving data

  1. #11
    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 never worked much with CoD4, but in CoD2 it's just setcvar("foo", "test") and getcvar("foo")
    timescale 0.01

  2. #12
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by TheHawk1337 View Post
    My apologies if I made myself unclear. I have no reason to use files, it just seemed the best solution to me so hence my focus on those. Any other possible methods are welcome (such as seta as kung foo man says).
    Also, it was not meant as a request but as a question/seeking advice on what to do.

    I do have a question about the seta function. I cannot find the function to read a cvar, is this even possible? Because that I was what I need to check if the map is in a cvar.

    My apologies and thanks!
    I am getting a bit tired of having to repeat myself - you CANNOT - that means no, not, never - store strings in dvars once the server rotates.

    I'll say it again - what you are attempting to do cannot be done in COD4 - once the server roates, all dvar strings are emptied of their values.

    So, asking about reading a dvar is pointless given what you are attempting.

    You will have to go back to storing stuff on players using the setStat()/getStat() functions, and checking to make sure they've been with the server through X number of rotations. And then get the stored values off them.
    Last edited by Tally; 1st October 2015 at 19:37.

  3. #13
    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 just tested it fast, made link to iw3mp.exe and added +set dedicated 2

    Code:
    map mp_bog
    set foo 123
    map_rotate
    foo ------> will print 123, as expected from CoD2
    So cvar is clearly there, right? Or GSC cannot access them?

    Edit: I just recalled the functions are named setdvar(key, value) and getdvar(key) in CoD4.
    timescale 0.01

  4. #14
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by kung foo man View Post
    I just tested it fast, made link to iw3mp.exe and added +set dedicated 2

    Code:
    map mp_bog
    set foo 123
    map_rotate
    foo ------> will print 123, as expected from CoD2
    So cvar is clearly there, right? Or GSC cannot access them?

    Edit: I just recalled the functions are named setdvar(key, value) and getdvar(key) in CoD4.
    Just tested on my dedicated COD4 box - didn't work.

    Next!

Tags for this Thread

Posting Permissions

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