Raised This Month: $51 Target: $400
 12% 

Problem with nVault


Post New Thread Reply   
 
Thread Tools Display Modes
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-19-2012 , 11:16   Re: Problem with nVault
Reply With Quote #11

Quote:
Originally Posted by tcPane View Post
Sorry for doubleposting,
If you truly were, you wouldn't have done it...

Quote:
for what is EOS and what it mean?
End Of String
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 08-19-2012 at 11:16.
YamiKaitou is offline
tcPane
Senior Member
Join Date: Sep 2010
Old 08-19-2012 , 12:17   Re: Problem with nVault
Reply With Quote #12

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
#include <amxmodx>
#include <nvault>

new g_szAuthid33 ][ 32 ]
new 
g_nVault

new g_iPlayerXP33 ]
new 
g_iPlayerLevel33 ]

public 
plugin_init()
{
    
g_nVault nvault_open"vault_name" )
}

public 
plugin_end()
{
    
nvault_closeg_nVault )
}

public 
client_authorizedid )
{
    
get_user_authid(idg_szAuthidid ], charsmaxg_szAuthid[] ) )
    
Load_Dataid )
}

public 
client_disconnectid )
{
    if( 
g_szAuthidid ][ ] )
    {
        
Save_Dataid )
        
g_szAuthidid ][ ] = EOS
    
}
}

Load_Data(id)
{
    new 
szVaultData[32], szPlaye_XP[12], szPlayerLevel[12];

    if( 
nvault_get(g_nVaultg_szAuthidid ], szVaultDatacharsmax(szVaultData)) )
    {

        
parse(szVaultDataszPlaye_XPcharsmax(szPlaye_XP), szPlayerLevelcharsmax(szPlayerLevel));

        
g_iPlayerXP[id] = str_to_num(szPlaye_XP);
        
g_iPlayerLevel[id] = str_to_num(szPlayerLevel);
        return 
1;
    }

    
g_iPlayerXP[id] = g_iPlayerLevel[id] = 0;
    return 
0;
}

Save_Data(id)
{
    new 
szVaultData[32]
    
formatex(szVaultDatacharsmax(szVaultData), "%d %d"g_iPlayerXP[id], g_iPlayerLevel[id]);
    
nvault_set(g_nVaultg_szAuthidid ], szVaultData);

    return 
1;

I saw now. When shut down server and start it again all players level and xp are 0... can u fix that?
tcPane is offline
Old 08-21-2012, 13:27
tcPane
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
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 10:16.


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