Raised This Month: $ Target: $400
 0% 

nvault code help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 06-24-2007 , 06:48   nvault code help
Reply With Quote #1

this code dosent load can you help me and plz only post back if you can help me..

Code:
 
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <fun>
#include <cstrike>
 
#define PLUGIN "nVault"
#define VERSION "1.0"
#define AUTHOR "...."
 
new g_vault
new IP[33]
new XP[33]
new CLASS[33]
public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    g_vault = nvault_open("VAULT")
    register_event("ResetHUD","event_spawn","be")
    register_event( "DeathMsg", "eDeath", "a" )
}
public client_putinserver(id)
{
    LoadData(id)
}
public client_disconnect(id) {
    SaveData(id)
 
    XP[id] = 0
    CLASS[id] = 0
    IP[id] = 0
}
public SaveData(id)
{
    new AuthID[35]
    get_user_authid(id,AuthID,34)
 
    new vaultkey[64],vaultdata[256]
    format(vaultkey,63,"%s-FX",AuthID)
    format(vaultdata,255,"%i#%i#",XP[id],CLASS[id])
    nvault_set(g_vault,vaultkey,vaultdata)
    return PLUGIN_HANDLED
}
public LoadData(id)
{
    new AuthID[35]
    get_user_authid(id,AuthID,34)
 
    new vaultkey[64],vaultdata[256]
    format(vaultkey,63,"%s-FX",AuthID)
    format(vaultdata,255,"%i#%i#",XP[id],CLASS[id])
    nvault_get(g_vault,vaultkey)
    return PLUGIN_HANDLED
}
public event_spawn(id)
{
ShowHud(id)
}
public eDeath( ) 
{  
new attacker = read_data(1)
XP[attacker] += 20
ShowHud(attacker)
}
public ShowHud(id)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "CLASS: %i^nXP: %i",CLASS[id],XP[id])
}
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 06-24-2007 at 06:49. Reason: no life
fxfighter is offline
Send a message via MSN to fxfighter
mateo10
Veteran Member
Join Date: Jan 2006
Old 06-24-2007 , 07:09   Re: nvault code help
Reply With Quote #2

I think this will work.
Replace your loading function with this:
Code:
public LoadData(id) {     new AuthID[35]     get_user_authid(id,AuthID,34)       new vaultkey[64],vaultdata[256]     format(vaultkey,63,"%s-FX",AuthID)     format(vaultdata,255,"%i#%i#",XP[id],CLASS[id])     nvault_get(g_vault,vaultkey,vaultdata,255)     replace_all(vaultdata, 255, "#", " ")     new playerxp[32], playerclass[32]     parse(vaultdata, playerxp, 31, playerclass, 31)     XP[id] = str_to_num(playerxp)     CLASS[id] = str_to_num(playerclass)     return PLUGIN_HANDLED }

Last edited by mateo10; 06-24-2007 at 07:13.
mateo10 is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 06-24-2007 , 07:20   Re: nvault code help
Reply With Quote #3

Thx it worked i never give karma but you deserve it
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
mateo10
Veteran Member
Join Date: Jan 2006
Old 06-24-2007 , 08:25   Re: nvault code help
Reply With Quote #4

No problem. I'm glad to help.
mateo10 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 21:28.


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