Raised This Month: $ Target: $400
 0% 

nVault help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-12-2005 , 23:04   nVault help...
Reply With Quote #1

Basically I need help with the eniter thing.


How would i look up a players, lets say for the sake of this post xp.



e.g. I want to looks up player Jon's xp through his steamid .


thnx
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-12-2005 , 23:22  
Reply With Quote #2

This should help you:
Code:
#include <amxmodx> #include <nvault> #define VAULTNAME "MyVault" // The name of your vault file new g_VaultHandle; public plugin_init() {   // ... } public savexp( id ) {   g_VaultHandle = nvault_open(VAULTNAME);   // Check if the vault opens properly?   if( g_VaultHandle == INVALID_HANDLE )   {     log_amx("Error opening nVault file: %s", VAULTNAME);   }   // Create some vars and get the player's auth id   new szAuthID[33], szXP[21], TimeStamp;   get_user_authid(id, szAuthID, 32);   // Get their XP   nvault_lookup(g_VaultHandle, szAuthID, szXP, 20, TimeStamp)   // Add XP   new iXPamt, iXPcurrent;   iXPamt = str_to_num(szXP); // Their current amount of stored XP   iXPamt += iXPcurrent // Add 2 totals together, iXPcurrent being their current XP amount   // Now we need to convert iXPamt to a string   new szXPamt[21];   num_to_str(iXPamt, szXPamt, 20);   // Save the XP to vault   nvault_set(g_VaultHandle, szAuthID, szXPamt); }
NOTE: nvault_close is still broken so all of the data will be reset if the server crashes or restarts!
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 10-12-2005 , 23:24  
Reply With Quote #3

actually nvault_close.... doesn;t crash anymore like it used to, but the nvault is totally useless in 1.60 because it doesn;t really save anything to the vault file.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-12-2005 , 23:27  
Reply With Quote #4

I wasn't saying it did

I was saying IF the server happened to crash it would reset/erase the data.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 23:46.


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