Page 1 of 1

JBPacks bankas

Posted: 2011 Nov 04 17:34
by Pukuotukas951
Bandziau perkurti viena tasku banka ir ji pritaikyti JB shopui, tai vat nelb. gaunasi galit padet? Sita kodo dali reikia ikelti i pati shopa. Tik nezinau ar cia gerai, labai noreciau is aarno atsakymo.

Code: Select all

new gVault;new gIP[ 32 ];new vKey[ 64 ];new vData[ 64 ];  /* --| Saving JBPacks */stock save_client_points( index ){    /* --| Open the vault file */    gVault = nvault_open( "JBPacks_Bankas" );        /* --| If vault return -1, lets stop this shit */    if( gVault == INVALID_HANDLE )    {        set_fail_state( "[INFO] nValut ERROR: =-> Invalid-Handle" );    }        /* --| Get the player ip */    get_user_ip( index, gIP, charsmax( gIP ), 1 );        /* --| Setting stuff on vault file, and close the file */    formatex( vKey, charsmax( vKey ), "%sPOINTS", gIP );    formatex( vData, charsmax( vData ), "%d", g_jbpacks[ index ] );    nvault_set( gVault, vKey, vData );    nvault_close( gVault );} /* --| Loading client JBPacks */stock load_client_points( index ){    /* --| Open the vault file */    gVault = nvault_open( "JBPacks_Bankas" );        /* --| If vault return -1, lets stop this shit */    if( gVault == INVALID_HANDLE )    {        set_fail_state( "[INFO] nValut ERROR: =-> Invalid-Handle" );    }        /* --| Get the player ip */    get_user_ip( index, gIP, charsmax( gIP ), 1 );        /* --| Get the player points, then, close the nvault vile */    formatex( vKey, charsmax( vKey ), "%sPOINTS", gIP );    g_jbpacks[ index ] = nvault_get( gVault, vKey );    nvault_close( gVault );}