Raised This Month: $ Target: $400
 0% 

Solved Need Code For CFG FILE


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-24-2022 , 01:46   Re: Need Code For CFG FILE
Reply With Quote #1

Map-specific config files are loaded automatically by AMX Mod X so there is no reason to do anything with those files directly. You simply need to read the cvar values like you would do for any cvar. damage220 gave you an example of one way to read the cvar value.
__________________
fysiks is offline
Begineer Programmer
Member
Join Date: Nov 2021
Old 07-24-2022 , 16:45   Re: Need Code For CFG FILE
Reply With Quote #2

Quote:
Originally Posted by fysiks View Post
Map-specific config files are loaded automatically by AMX Mod X so there is no reason to do anything with those files directly. You simply need to read the cvar values like you would do for any cvar. damage220 gave you an example of one way to read the cvar value.
Here is Code from your Github Admin.amxx that was admin per map config posted by CounterStrike1.6

PHP Code:
loadSettings()
{
    new 
configDir[64], filename[96]
    
get_configsdir(configDircharsmax(configDir))
    
format(filenamecharsmax(filename), "%s/users.ini"configDir)
    
loadUsersFile(filename)

    
// Load Map-Specific Admins
    
new szMapname[32], prefixBreak
    get_mapname
(szMapnamecharsmax(szMapname))

    
filename[0] = EOS
    format
(filenamecharsmax(filename), "%s/maps/users-%s.ini"configDirszMapname)
    
loadUsersFile(filename)

    if( ( 
prefixBreak strfind(szMapname"_") ) != -)
    {
        
szMapname[prefixBreak] = EOS
        filename
[0] = EOS
        format
(filenamecharsmax(filename), "%s/maps/users-%s.ini"configDirszMapname)
        
loadUsersFile(filename)
    }

Can you edit this and add cfg file in it ... it should read value from cfg file mp_maxrounds and print in to client !!!

Last edited by Begineer Programmer; 07-24-2022 at 16:47.
Begineer Programmer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode