SA-MP Forums Archive
Really strange y_ini issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Really strange y_ini issue (/showthread.php?tid=385103)



Really strange y_ini issue - Penki4a - 14.10.2012

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?


Re: Really strange y_ini issue - Stigg - 14.10.2012

Use:

pawn Код:
INI_ParseFile
To load the file.

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


Re: Really strange y_ini issue - Penki4a - 14.10.2012

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?


Re: Really strange y_ini issue - Penki4a - 24.10.2012

bump


Re: Really strange y_ini issue - Azazelo - 24.10.2012

Quote:

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

Case sensitive