Dini help
#1

Hey guys,

Could anyone give me some help with dini, and explain the functions a little bit?

Like what does:
dini_Int
dini_IntSet
dini_Set

And how can i use those, like howmutch arguments do i need for them
Hope you guys can help me out,
~Wesley
Reply
#2

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Hey guys,

Could anyone give me some help with dini, and explain the functions a little bit?

Like what does:
dini_Int
dini_IntSet
dini_Set

And how can i use those, like howmutch arguments do i need for them
Hope you guys can help me out,
~Wesley
I am not 100% sure since I don't really use dini but here we go...


dini_IntSet - Sets an integer (like score, adminlevel etc.)

dini_Set - Sets everything that is not a float or integer, so that would be a string (like banreasons etc.)

dini_Int - Not sure, but I think that reads an integer?

Example:

pawn Код:
new pname[42];//Name variable
GetPlayerName(playerid, pname, sizeof(pname));//Gets the name so we can save it below V

format(file, sizeof(file), "\Users\%s.ini", pname);//An example, this will save/write it to Users\<Name>.ini

dini_Create(file);//Creates the file
dini_Set(file, "password", params);//Params from a command, it will set the password UNHASHED.
dini_IntSet(file, "level", 0);//Sets an integer, in this case, level. The last 0 is for the level you want at start
Reply
#3

i wouldnt recommend using dini now, its old and inefficient, use djson ( official dini2) or use y_ini ( ****** version of dini) .
Reply
#4

Hmm okay - Thanks for those

What would i do, if i want to get something out the .ini? With the dini_IntSet(file, "Level", 0); it made the level line, but how do i know when the level is at 1, 2, 3 so i can use it in a command?

Like if Level == 18 you can do this and that, and when your level == 17, you cant do that

Edit:
Quote:
Originally Posted by xalith
Посмотреть сообщение
i wouldnt recommend using dini now, its old and inefficient, use djson ( official dini2) or use y_ini ( ****** version of dini) .
What would you use/what are you using, djson or y_ini?
And what is more efficient in your opinion?
Reply
#5

I would suggest you use DJson or MySQL.
Reply
#6

pawn Код:
new level = dini_Int(file, "Level");
if(level == XX)
{
   Kick(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)