Thread: nVault Tutorial
View Single Post
yan1255
Senior Member
Join Date: Jul 2011
Old 03-03-2013 , 13:35   Re: nVault
Reply With Quote #44

Why do you remove the vault?

Code:
public cmdGetMoney(id)
{
    //Retrieve a single item from vault
    //Example: STEAM_0:0:1234 16000

    new szKey[40];
    formatex( szKey , charsmax( szKey ) , "%sMONEY" , g_szAuthID[id] );
    new iMoney = nvault_get( g_Vault , szKey );

    //If our money key was found, set the users money to the value we read from vault and
    //delete the key so the player will not get the same money again.
    if ( iMoney )
    {
        cs_set_user_money( id , iMoney , 1 );
        nvault_remove( g_Vault , szKey );

        client_print( id , print_chat , "* Your money was loaded from vault: $%d" , iMoney );
    }
    else
    {
        client_print( id , print_chat , "* You have no money entry in vault." );
    }
}
__________________
yan1255 is offline