Results 1 to 10 of 14

Thread: CoD4 - openfile

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts
    Well, thanks a lot but I have few questions.

    Are these stats server-side or client-side? (I mean can player edit his stats) (What is the path to it)


    Is it correct?

    customStatsTable.csv
    PHP Code:
    3150,kills
    3151
    ,score
    3152
    ,connects
    3153
    ,spawns 
    .gsc script
    PHP Code:
    getDatadataName )
    {
        return 
    self getStatint(tableLookup"mp/customStatsTable.csv"1dataName)) );
    }

    setDatadataNamevalue )
    {
        
    self setStatint(tableLookup"mp/customStatsTable.csv"1dataName)), value );    
    }

    addDatadataNamevalue )
    {
        
    newValue getDatadataName ) + value;
        
    self setStatint(tableLookup"mp/customStatsTable.csv"1dataName)), newValue );    

    mod.csv
    PHP Code:
    stringtable,mp/customStatsTable.csv 

  2. #2
    Private
    Join Date
    Jul 2012
    Posts
    76
    Thanks
    9
    Thanked 56 Times in 38 Posts
    Quote Originally Posted by BlancO View Post
    Are these stats server-side or client-side? (I mean can player edit his stats) (What is the path to it)
    Client-side. I tried editing stats in the past. Worked for like every mod-server. It's not like a simple .txt document which you can add manually. It's a .dat file I guess.

  3. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by BlancO View Post
    Well, thanks a lot but I have few questions.

    Are these stats server-side or client-side? (I mean can player edit his stats) (What is the path to it)


    Is it correct?

    customStatsTable.csv
    PHP Code:
    3150,kills
    3151
    ,score
    3152
    ,connects
    3153
    ,spawns 
    .gsc script
    PHP Code:
    getDatadataName )
    {
        return 
    self getStatint(tableLookup"mp/customStatsTable.csv"1dataName)) );
    }

    setDatadataNamevalue )
    {
        
    self setStatint(tableLookup"mp/customStatsTable.csv"1dataName)), value );    
    }

    addDatadataNamevalue )
    {
        
    newValue getDatadataName ) + value;
        
    self setStatint(tableLookup"mp/customStatsTable.csv"1dataName)), newValue );    

    mod.csv
    PHP Code:
    stringtable,mp/customStatsTable.csv 
    The data file is stored client-side, @[COD4 INSTALL]/players/PROFILE NAME/mods/mod_folder name/mpdata

    The data file is encrypted, but the encryption algorithm is now well known, and if you have the cheat-engine, you can edit them quite easily. However, not everyone understands it, so it's not like any old noob can open it like a text file and edit it.

    And yes - you have everything correct. That should work for you nicely. Just a word of warning about using the setStat()/getStat() functions - don't do too much of it onPlayerConnect(). You will run into a notorious server crash problem - the server command overflow. This is caused by too many players using the setStat()/getStat() functions at the same time if you have >= 24 players joining the server at the same time. Try to move stuff you are doing at onPlayerConnect() to onJoinedTeam(), or better yet, onPlayerSpawned(). That way you can avoid the build-up of pending server commands.

    If you usually have less than 24 players, that's fine. It is only on big servers it happens a lot.

    If you have any other questions about COD4, don't hesitate to ask. I was on the mod tools team and helped build them. So, I kind of know quite a bit about how it all works, etc.

    Here is a picture of me, out at the Infinity Ward Studio for the launch of COD4:

    Last edited by Tally; 18th September 2013 at 16:04.

  4. The Following 3 Users Say Thank You to Tally For This Useful Post:

    BlancO (18th September 2013),kung foo man (18th September 2013),YuriJurek (18th September 2013)

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
  •