FileSystem
#5

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!
Reply


Messages In This Thread
FileSystem - by clavador - 04.07.2011, 06:49
Re: FileSystem - by Lorenc_ - 04.07.2011, 07:11
Respuesta: Re: FileSystem - by clavador - 04.07.2011, 07:51
Re: Respuesta: Re: FileSystem - by Basicz - 04.07.2011, 07:58
Respuesta: Re: Respuesta: Re: FileSystem - by clavador - 04.07.2011, 08:05

Forum Jump:


Users browsing this thread: 1 Guest(s)