Dini help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dini help (
/showthread.php?tid=259568)
Dini help -
Wesley221 - 05.06.2011
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
Re: Dini help -
alpha500delta - 05.06.2011
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
Re: Dini help -
xalith - 05.06.2011
i wouldnt recommend using dini now, its old and inefficient, use djson ( official dini2) or use y_ini ( ****** version of dini) .
Re: Dini help -
Wesley221 - 05.06.2011
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?
Re: Dini help -
Markx - 05.06.2011
I would suggest you use DJson or MySQL.
Re: Dini help -
Sascha - 05.06.2011
pawn Код:
new level = dini_Int(file, "Level");
if(level == XX)
{
Kick(playerid);
}