[Y_INI] No load
#1

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;
}
Reply
#2

does that file exists?
Reply
#3

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

http://prntscr.com/b1w99p
Reply
#4

what is in that file can u show it too?
Reply
#5

the file content is:

Quote:

[Y-INI]
Tutorial = 10

Reply
#6

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

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

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;

Reply
#9

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[])
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)