Thread: [Solved] Need Code For CFG FILE
View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-24-2022 , 20:19   Re: Need Code For CFG FILE
Reply With Quote #27

That only gets the file path though the map name will always be an empty string. I would probably suggest creating a function called something like "get_map_maxrounds_config" with the map name as the argument. Here is a basic outline of a function that will do what you want:

PHP Code:
get_map_maxrounds_config(szMapname[])
{
    
// Get the file name just like you did already

    // Open the file

    // Loop through the file's lines

        // Parse each line
        // if first parameter is "mp_maxrounds"
            // read second parameter, store it in a variable
    
    // Close file

    // return mp_maxrounds variable

__________________

Last edited by fysiks; 07-24-2022 at 20:27.
fysiks is offline