[Djson] Issue
#1

Why isn't loading the data on it

config.json:
PHP код:
 {
    
"config": 
    {
            
"gamemodetext": "SAP 7.0 Alpha",
            
"servername": "San Andreas Playground",
            
"serverweb": "saplayground.ml",
            
"serverforum": "forum.saplayground.ml",
            
"ircbot1": "StrikerX",
            
"ircbot2": "ZeroX",
            
"ircserv": "pool.irc.tl",
            
"ircport": "(6667)",
            
"ircchannel": "SAP.echo",
            
"ircachannel": "SAP",
    }
} 
GMInit:

PHP код:
djson_GameModeInit();
new 
str[20], str2[20], str3[20], str4[20], str6[20], str8[20], str9[20], str10[20], string[250];
    
format(str6, sizeof(str6), "%s", dj("config.json","config/servername")); 
    
serverName = str6;
    
format(str3, sizeof(str3), "#%s", dj("config.json","config/serverforum")); 
    
serverForum = str3;
    
format(str4, sizeof(str4), "%s", dj("config.json","config/serverwebsite")); 
    
serverWebsite = str4;
    
format(str10, sizeof(str10), "%s", dj("config.json","config/ircbot2")); 
    
ircBot2 = str10;
    
format(str9, sizeof(str9), "%s", dj("config.json","config/ircbot1")); 
    
ircBot1 = str9;
    
format(str8, sizeof(str8), "%s", dj("config.json","config/ircserver")); 
    
ircServer = str8;
    
ircPort = djInt("config.json","config/ircport");
    
format(str, sizeof(str), "#%s", dj("config.json","config/ircchannel")); 
    
ircChannel = str;
    
format(str2, sizeof(str2), "#%s", dj("config.json","config/ircachannel")); 
    
ircaChannel = str2;
    
format(string, sizeof(string), "[SAP IRC]: Connecting to Server %s using Port: %d, With Config IRCBot1 : %s , IRCBot2: %s, in Channels : %s, %s",ircServer, ircPort, ircBot1, ircBot2, ircChannel, ircaChannel); 
    print(string); 
Output:

PHP код:
[SAP IRC]: Connecting to Server  using Port: 0, With Config IRCBot1 :  , IRCBot2
: , in Channels : #, # 
Reply
#2

PHP код:
format(serverName, sizeof(serverName), "%s", dj("config.json","config/servername")); 
// and so on... 
It does works?
Reply
#3

PHP код:
format(str8, sizeof(str8), "%s", dj("config.json","config/ircserver"));  
ircServer = str8; 
"config/ircserver"

config says

"ircserv": "pool.irc.tl",
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)