Raised This Month: $ Target: $400
 0% 

nVault help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-12-2005 , 23:22  
Reply With Quote #1

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
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