Quote:
Originally Posted by Basicz
Hmm..... ( Honestly I dont know how it works too, hehe, but I got it working in my admin script like this... )
pawn Код:
#define nyancat_directory "nyans%s.INI"
new nyanCats[ MAX_PLAYERS ] ;
public OnPlayerConnect( playerid ) { new ohai[ 64 + 24 ] ; format( ohai, sizeof ( ohai ), nyancat_directory, name( playerid ) ); // stock name( playerid ) { blablablabla } INI_ParseFile( ohai, "loadNyanCats", .bExtra = true, .extra = playerid );
new lol[ 128 ] ; format( lol, sizeof ( lol ), "Your nyancats are : %i.", nyanCats[ playerid ] );
SendClientMessage( playerid, -1, lol );
return 1; }
forward loadNyanCats( playerid, name[ ], value[ ] ); public loadNyanCats( playerid, name[ ], value[ ] ) { INI_Int( "Nyancats", nyanCats[ playerid ] ); return 1; }
|
Thanks for the example.
I was looking at Djson/Tweaking page and I've found that you can turn off the "auto commit" thing so files are get/set from cache instead from files.
I'll be sticking to it now, as I find Y_ini a little complicated with the syntax and all of that. I don't wanna break my head trying to understand something I'm doing for entertainment. I'm just trying to get the most efficient/easy way to manage my files.
Thank you for the responses!