[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(str6sizeof(str6), "%s"dj("config.json","config/servername")); 
    
serverName str6;
    
format(str3sizeof(str3), "#%s"dj("config.json","config/serverforum")); 
    
serverForum str3;
    
format(str4sizeof(str4), "%s"dj("config.json","config/serverwebsite")); 
    
serverWebsite str4;
    
format(str10sizeof(str10), "%s"dj("config.json","config/ircbot2")); 
    
ircBot2 str10;
    
format(str9sizeof(str9), "%s"dj("config.json","config/ircbot1")); 
    
ircBot1 str9;
    
format(str8sizeof(str8), "%s"dj("config.json","config/ircserver")); 
    
ircServer str8;
    
ircPort djInt("config.json","config/ircport");
    
format(strsizeof(str), "#%s"dj("config.json","config/ircchannel")); 
    
ircChannel str;
    
format(str2sizeof(str2), "#%s"dj("config.json","config/ircachannel")); 
    
ircaChannel str2;
    
format(stringsizeof(string), "[SAP IRC]: Connecting to Server %s using Port: %d, With Config IRCBot1 : %s , IRCBot2: %s, in Channels : %s, %s",ircServerircPortircBot1ircBot2ircChannelircaChannel); 
    print(string); 
Output:

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

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

PHP код:
format(str8sizeof(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)