SA-MP Forums Archive
[Y_INI] No load - 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: [Y_INI] No load (/showthread.php?tid=606789)



[Y_INI] No load - CrashCar - 09.05.2016

Hi.

I wonder because the file does not load. What do I do wrong?

pawn Код:
new variable;

main()
{
    INI_Load("ForumSAMP.ini");
    printf("variable %i", variable); // prints 0
}

INI:ForumSAMP[](name[], value[])
{
    INI_Int("Tutorial", variable);
    return 0;
}



Re: [Y_INI] No load - SyS - 09.05.2016

does that file exists?


Re: [Y_INI] No load - CrashCar - 09.05.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
does that file exists?
Yes.

http://prntscr.com/b1w99p


Re: [Y_INI] No load - SyS - 09.05.2016

what is in that file can u show it too?


Re: [Y_INI] No load - CrashCar - 09.05.2016

the file content is:

Quote:

[Y-INI]
Tutorial = 10




Re: [Y_INI] No load - SyS - 09.05.2016

so you used a tag then use it in the INI_Load params too


Re: [Y_INI] No load - CrashCar - 09.05.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
so you used a tag then use it in the INI_Load params too
Then what do I do?


Re: [Y_INI] No load - SyS - 09.05.2016

do this
PHP код:
new variable;
main()
{
    
INI_Load("ForumSAMP.ini");
    
printf("variable %i"variable); // prints 0
}
INI:ForumSAMP[Y-INI](name[], value[])
{
    
INI_Int("Tutorial"variable);
    return 
0;




Re: [Y_INI] No load - Konstantinos - 09.05.2016

Reading from a file with tags can be used as:
pawn Код:
INI:filename[tagname](name[], value[])
As your tag is "Y-INI", I'm not entirely sure that will not give errors on compiling because the tag is used as part of name in the public function and "-" symbol is not a valid one. Try some other tag such as "Y_INI" and then:
pawn Код:
INI:ForumSAMP[Y_INI](name[], value[])



Re: [Y_INI] No load - SyS - 09.05.2016

yeah thats right '-' can cause some prob for you as it is not valid