Raised This Month: $ Target: $400
 0% 

[nVault] Invalid vault id: 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-15-2010 , 13:28   [nVault] Invalid vault id: 0
Reply With Quote #1

Im getting this error everytime the save function is called.
How do i fix this?

PHP Code:
L 05/15/2010 19:09:03: [AMXXDisplaying debug trace (plugin "myplugin.amxx")
L 05/15/2010 19:09:03: [AMXXRun time error 10native error (native "nvault_set")
L 05/15/2010 19:09:03: [AMXX]    [0myplugin.sma::Save (line 430)
L 05/15/2010 19:09:03: [AMXX]    [1myplugin.sma::client_disconnect (line 360)
L 05/15/2010 19:09:03: [nVaultInvalid vault id
The save function:
PHP Code:
public Save(iPlayer)
{    
    static 
data[256];
    new 
len formatex(datasizeof(data) - 1"%i"g_iCash[iPlayer]);
    
    for( new 
iItem 0iItem g_iItemCountiItem++ )
    {
        
len += formatex(data[len], sizeof(data) - len 1" %i"g_iItemLevel[iPlayer][iItem]);
    }
    
    for( new 
iWeap 0iWeap g_iWeapCountiWeap++ )
    {
        
len += formatex(data[len], sizeof(data) - len 1" %i"g_iWeapLevel[iPlayer][iWeap]);
    }
    
    
nvault_set(g_vaultg_iAuthIDdata); //Line 430

Client_Disconnect
PHP Code:
public client_disconnectiPlayer )
{
    
Save(iPlayer); //Line 360
    
g_first_time[iPlayer] = 0;

Global Vars
PHP Code:
new g_first_time[32];
new 
g_vault
plugin_init's nvault open
PHP Code:
g_vault nvault_open("cashmod004"); 
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-15-2010 , 13:31   Re: [nVault] Invalid vault id: 0
Reply With Quote #2

Check if the vault id is valid when you open it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-15-2010 , 13:34   Re: [nVault] Invalid vault id: 0
Reply With Quote #3

Like this:
PHP Code:
    if( g_vault == INVALID_HANDLE )
    {
        
set_fail_state"Error opening nVault" );
    } 
?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-15-2010 , 13:39   Re: [nVault] Invalid vault id: 0
Reply With Quote #4

Quote:
Originally Posted by NiQu View Post
Like this:
PHP Code:
    if( g_vault == INVALID_HANDLE )
    {
        
set_fail_state"Error opening nVault" );
    } 
?
Yep.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-15-2010 , 13:42   Re: [nVault] Invalid vault id: 0
Reply With Quote #5

Actually, that won't be your problem, but it's still safe to make sure.
You are somehow saving the client's data without ever opening the vault.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-15-2010 , 13:50   Re: [nVault] Invalid vault id: 0
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
Actually, that won't be your problem, but it's still safe to make sure.
You are somehow saving the client's data without ever opening the vault.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-15-2010 , 13:52   Re: [nVault] Invalid vault id: 0
Reply With Quote #7

Yh i read that but the line in plugin_init, shouldnt that open that vault ?-
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-15-2010 , 13:43   Re: [nVault] Invalid vault id: 0
Reply With Quote #8

Thats strange? Am i opening it wrong?

PHP Code:
g_vault nvault_open("cashmod004"); 
</span></span>
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-15-2010 , 13:44   Re: [nVault] Invalid vault id: 0
Reply With Quote #9

Quote:
Originally Posted by NiQu View Post
Thats strange? Am i opening it wrong?

PHP Code:
g_vault nvault_open("cashmod004"); 
</span></span>
Where are you opening it?
plugin_init()?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-15-2010 , 13:45   Re: [nVault] Invalid vault id: 0
Reply With Quote #10

Yes, if u read the first post it says "plugin_init's nvault open".
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode