dini_Set inputtext
#1

Well for some reason the server thinks; dini_Set(accountfile,"Password",inputtext);
means Password=0. What is that?
I made a print(inputtext); and It is exactly what It should be but It dini_Sets 0? WTF?

Thanks in advance for anyone willing to help me.

I have tried formatting a string, and It does the exact same thing.
Reply
#2

Isn't there a dini_SetString? You should probably use that
Reply
#3

No, that is the function that is used for setting strings. It's strange that it's doing that, never heard of that before. Are you absolutely sure that the accountfile variable contains the correct location of the file? It's all I can think of, otherwise there must be something wrong with dini

You've also tried creating a separate string and formatting the contents of inputtext into it? I couldn't think of anything else to try, besides changing to y_ini or something
Reply
#4

No, there isn't. I've never had to use anything (when setting values) other then dini_Int and dini_Set.

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
No, that is the function that is used for setting strings. It's strange that it's doing that, never heard of that before. Are you absolutely sure that the accountfile variable contains the correct location of the file? It's all I can think of, otherwise there must be something wrong with dini

You've also tried creating a separate string and formatting the contents of inputtext into it? I couldn't think of anything else to try, besides changing to y_ini or something
It's very strange, and yes I've tried formatting It.
And yes, the accountfile location is correct, otherwise "Password" wouldn't exist in that file.
It's really strange. Maybe i have to have a bigger string size?
I raised it to 64 (when i tried to format it into a string) to try but maybe It requires even bigger?

If so, It sucks hard.
I don't really understand how to use y_ini to be honest, I looked at It but all the information made It look so advanced to use. (Nor did i understand what sscanf 2.0 is from the beginning, it just says its better then the old sscanf).

I've heard that people prefer sscanf2.0 and zcmd, but couldn't find zCMD or understand sscanff or y_ini.
Reply
#5

y_ini is simple to use really. It's very similar to writing to a file in general using the stock functions, it just does all of the ini formatting and management for you.

Doing what you want through y_ini would be:

pawn Код:
new
    INI:ini = INI_Open(accountfile);
INI_WriteString(ini, "Password", inputtext);
INI_Close(ini);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)