Raised This Month: $ Target: $400
 0% 

Nvault problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
adiif1
Member
Join Date: Apr 2013
Old 12-06-2015 , 10:25   Nvault problem
Reply With Quote #1

Thanx for help!


Code:
L 12/06/2015 - 16:16:25: [nVault] Invalid vault id: 0

L 12/06/2015 - 16:16:25: [AMXX] Displaying debug trace (plugin "cso_zombie_scenario.amxx")
L 12/06/2015 - 16:16:25: [AMXX] Run time error 10: native error (native "nvault_set")
L 12/06/2015 - 16:16:25: [AMXX] [0] cso_zombie_scenario.sma::Save_PlayerLevel (line 5564)
L 12/06/2015 - 16:16:25: [AMXX] [1] cso_zombie_scenario.sma::client_disconnect (line 652)
L 12/06/2015 - 16:16:25: [nVault] Invalid vault id: 0

L 12/06/2015 - 16:16:25: [AMXX] Displaying debug trace (plugin "cso_zombie_scenario.amxx")
L 12/06/2015 - 16:16:25: [AMXX] Run time error 10: native error (native "nvault_close")
L 12/06/2015 - 16:16:25: [AMXX] [0] cso_zombie_scenario.sma::plugin_end (line 5545)

Code:
public plugin_end()
{
nvault_close(g_vault);
} 
 
Save_PlayerLevel(id)
{
new PlayerName[32], PlayerAuthID[35];
get_user_name(id, PlayerName, charsmax(PlayerName))
get_user_authid(id, PlayerAuthID, charsmax(PlayerAuthID))
 
new vaultkey[64], vaultdata[256];
 
if(SteamUser[id] == true)
{
format(vaultkey, 63, "%s-LevelInfo", PlayerAuthID)
} else {
format(vaultkey, 63, "%s-LevelInfo", PlayerName)
} 
 
format(vaultdata, 255, "%i#%i#", Player_Exp[id], Player_Level[id])
nvault_set(g_vault, vaultkey, vaultdata) 
return PLUGIN_CONTINUE;
}
 
Load_PlayerLevel(id)
{
new PlayerName[32], PlayerAuthID[35];
get_user_name(id, PlayerName, charsmax(PlayerName))
get_user_authid(id, PlayerAuthID, charsmax(PlayerAuthID))
 
new vaultkey[64], vaultdata[256];
 
if(SteamUser[id] == true)
{
format(vaultkey, 63, "%s-LevelInfo", PlayerAuthID)
} else {
format(vaultkey, 63, "%s-LevelInfo", PlayerName)
}
 
format(vaultdata, 255, "%i#%i#", Player_Exp[id], Player_Level[id])
nvault_get(g_vault, vaultkey, vaultdata, 255)
 
replace_all(vaultdata, 255, "#", " ")
 
new playerxp[32], playerlevel[32];
 
parse(vaultdata, playerxp, 31, playerlevel, 31)
 
Player_Exp[id] = str_to_num(playerxp)
Player_Level[id] = str_to_num(playerlevel)
return PLUGIN_CONTINUE;
}
 

public client_disconnect(id)
{
Save_PlayerLevel(id)
 
if(Status[id] == LOGGED || Status[id] == REGISTERED)
{
Accounts_Save(id)
}
 
new szName[32];
get_user_name(id, szName, 31);
 
print_color(0, "%L", LANG_PLAYER, "PLAYER_LEFTGAME", szName);
 
return PLUGIN_HANDLED;
}
adiif1 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-06-2015 , 10:53   Re: Nvault problem
Reply With Quote #2

You are not showing your full code so we cannot see if you are opening your vault like you need to be. That appears to be the cause of your error. Please use php tags when posting code, and indent your code.

Add at plugin_init()
PHP Code:
g_vault nvault_open"vaultname" 
__________________

Last edited by Bugsy; 12-06-2015 at 10:56.
Bugsy is offline
adiif1
Member
Join Date: Apr 2013
Old 12-06-2015 , 11:25   Re: Nvault problem
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
You are not showing your full code so we cannot see if you are opening your vault like you need to be. That appears to be the cause of your error. Please use php tags when posting code, and indent your code.

Add at plugin_init()
PHP Code:
g_vault nvault_open"vaultname" 

Thanx, i have
PHP Code:
g_vault nvault_open("zbs_playerlevels"); 
in plugin_init
adiif1 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-06-2015 , 11:48   Re: Nvault problem
Reply With Quote #4

Ok..so does it work now?
__________________
Bugsy is offline
adiif1
Member
Join Date: Apr 2013
Old 12-07-2015 , 16:04   Re: Nvault problem
Reply With Quote #5

Yea, no work
adiif1 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-07-2015 , 16:46   Re: Nvault problem
Reply With Quote #6

Post your full code
__________________
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 17:49.


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