Really strange y_ini issue
#1

Alright so basically here's my stocks that i used to make a MOTD system:

pawn Код:
stock SaveMOTDS()
{
    //new file[16];
    new INI:File = INI_Open("motds.ini");
    INI_SetTag(File, "MOTDS");
    INI_WriteString(File, "Server", ServerMOTD);
    INI_WriteString(File, "LSPD", SAPDMOTD);
    INI_WriteString(File, "GOV", GOVMOTD);
    INI_WriteString(File, "HA", HAMOTD);
    INI_WriteString(File, "Admin", AdminMOTD);
    INI_WriteString(File, "Login", LoginMOTD);
    INI_Close(File);
    print("MOTDs saved successfully.");
    return 1;
}

INI:motds[MOTDS](name[], value[])
{
    INI_String("Server", ServerMOTD, 128);
    INI_String("LSPD", SAPDMOTD, 128);
    INI_String("GOV", GOVMOTD, 128);
    INI_String("HA", HAMOTD, 128);
    INI_String("Admin", AdminMOTD, 128);
    INI_String("Login", LoginMOTD, 128);
    return 0;
}

stock LoadMOTDS()
{
    new fileName[10] = "motds.INI";
    INI_Load(fileName);
    print("MOTDs loaded successfully.");
    return 1;
}
I save the file under OnGameModExit and i load it under OnGameModeInit...The file saves with data as folllows:

pawn Код:
[MOTDS]
Server = randomtext
LSPD = randomtext
GOV = randomtext
HA = randomtext
Admin = randomtext
Login = randomtext
So the files saves and there is no problem with that but i have simply no idea why it doesn't load after GMX,even though i call it with the LoadMOTDS stock under OnGameModeInit.On localhost works fine,but when i up it on our hosting service it doesn't work...i have every YSI library installed there too(3.1),so it's not from that.Can anyone help me?
Reply
#2

Use:

pawn Код:
INI_ParseFile
To load the file.

http://forum.sa-mp.com/showthread.ph...=INI_ParseFile
Reply
#3

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Use:

pawn Код:
INI_ParseFile
To load the file.

http://forum.sa-mp.com/showthread.ph...=INI_ParseFile
Uhm from what i understood from ******'s tutorial INI_ParseFile is an advanced function,which can be used to load multiple files with different names...Well idk why i need to use it,when i am loading a single file and i already have the filename defined?
Reply
#4

bump
Reply
#5

Quote:

stock LoadMOTDS()
{
new fileName[10] = "motds.INI";// <== linux is case sensitive
INI_Load(fileName);
print("MOTDs loaded successfully.");
return 1;
}

Case sensitive
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)