Raised This Month: $ Target: $400
 0% 

[nVault] Invalid vault id: 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-15-2010 , 13:48   Re: [nVault] Invalid vault id: 0
Reply With Quote #1

This isn't really related, but your global var for players should have 33 cells, not 32.

I can't really see what could be causing this. Check to see if your plugin sets fail state when you try opening it (with that check in there).
__________________
[ 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:50   Re: [nVault] Invalid vault id: 0
Reply With Quote #2

Tested and doesnt make any different wrecked, doesnt set fail state it gives me the same errors.
__________________
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:54   Re: [nVault] Invalid vault id: 0
Reply With Quote #3

lol, client_disconnect is called when someone disconnects? How can it be called before plugin_init, thats not common sense.
__________________
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:56   Re: [nVault] Invalid vault id: 0
Reply With Quote #4

I, too, was thinking about the function being called before the vault is opened, but he says it's giving him errors every single time the save function is called.
__________________
[ 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:58   Re: [nVault] Invalid vault id: 0
Reply With Quote #5

The error went away when i deleted it from client_disconnect but still, it wont load:S

Load Function:
PHP Code:
public Load(iPlayer)
{
    static 
data[256], timestamp;
    if( 
nvault_lookup(g_vaultg_iAuthID[iPlayer], datasizeof(data) - 1timestamp) )
    {
        
ParseLoadData(iPlayerdata);
        return;
    }
    else
    {
        
NewUser(iPlayer);
    }
}

public 
NewUser(iPlayer)
{
    
g_first_time[iPlayer] = 1;
    
    
g_iCash[iPlayer] = 200;
    
    for( new 
iItem 0iItem g_iItemCountiItem++ )
    {
        
g_iItemLevel[iPlayer][iItem] = 0;
    }
    for( new 
iWeap 0iWeap g_iWeapCountiWeap++ )
    {
        
g_iWeapLevel[iPlayer][iWeap] = 0;
    }
}

ParseLoadData(iPlayerdata[256])
{
    static 
num[6];
    
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1);
    
    
g_iCash[iPlayer] = str_to_num(num);
    
    for( new 
iItem 0iItem g_iItemCountiItem++ )
    {
        
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1);
        
g_iItemLevel[iPlayer][iItem] = clamp(str_to_num(num), 0g_iItemMaxLevel[iItem]);
    }
    
    for( new 
iWeap 0iWeap g_iWeapCountiWeap++ )
    {
        
strbreak(datanumsizeof(num) - 1datasizeof(data) - 1);
        
g_iWeapLevel[iPlayer][iWeap] = clamp(str_to_num(num), 0g_iWeapMaxLevel[iWeap]);
    }

__________________
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 , 14:36   Re: [nVault] Invalid vault id: 0
Reply With Quote #6

Show your full code (with client_disconnect).

Also, your stats can't load if you never save them on disconnect.
__________________
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 , 14:48   Re: [nVault] Invalid vault id: 0
Reply With Quote #7

I save them when u buy them in the menu.
The full code is 1500 lines.

Client_DC
PHP Code:
public client_disconnectiPlayer )
{
    
g_first_time[iPlayer] = 0;

__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-15-2010 , 19:54   Re: [nVault] Invalid vault id: 0
Reply With Quote #8

Are you calling nvault_close @ plugin_end() (or anywhere)? If not then this is likely your problem. I've seen this error occur when a vault file is used after it was not correctly closed in a previous usage. Let me know if the below fixes your problem.

To fix:

1. Rename your vault file.
2. Add nvault_close() in plugin_end().
__________________
Bugsy is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 05-15-2010 , 20:06   Re: [nVault] Invalid vault id: 0
Reply With Quote #9

@Bugsy, i have tested to rename the file, and i already got nvault_close(g_vault) in plugin_end.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-15-2010 , 20:18   Re: [nVault] Invalid vault id: 0
Reply With Quote #10

What is g_iAuthID? Show its definition and data assignment.

If its an array of strings holding each players authid then you need to include the player index on the var in your save function like you do in your load function.
__________________

Last edited by Bugsy; 05-15-2010 at 20:21.
Bugsy is offline
Reply



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