Raised This Month: $ Target: $400
 0% 

Removing vault data with nVault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-21-2006 , 07:24   Removing vault data with nVault
Reply With Quote #1

Is this how I would do it?
Code:
nvault_set(vault , key , "");

I'm trying to remove a SteamID from a vault file by command and doesn't want to work:
Code:
public concmd_removesteam(id , lvl , cid) {     if(!cmd_access(id , lvl , cid , 2))         return PLUGIN_HANDLED;     new arg[33];     read_argv(1 , arg , 32);     vault = nvault_open(VAULT_NAME);     if(vault == INVALID_HANDLE)     {         console_print(id , "[AMXX] Error opening vault file: %s" , VAULT_NAME);         return PLUGIN_HANDLED;     }     remove_quotes(arg);     trim(arg);     new temp[9] , timestamp;     if(!nvault_lookup(vault , arg , temp , 8 , timestamp))     {         console_print(id , "[AMXX] That STEAMID doesn't exist!");         nvault_close(vault);         return PLUGIN_HANDLED;     }     nvault_set(vault , arg , "");     nvault_close(vault);     new steamid[33] , players[32] , num , i;     for(i = 0; i < num; i++)     {         get_user_authid(players[i] , steamid , 32);         if(equal(steamid , arg))             flagged[players[i]] = false;     }     console_print(id , "[AMXX] %s removed from vault file: ^"%s^"" , arg , VAULT_NAME);     return PLUGIN_HANDLED; }
__________________
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
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-21-2006 , 07:59  
Reply With Quote #2

I think thats about the only way.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-21-2006 , 11:34  
Reply With Quote #3

Is everything correct there?
__________________
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
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-22-2006 , 01:34  
Reply With Quote #4

Oops, I forgot to use get_players. Anywho ... Is there anything wrong with that code?
__________________
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
slurpycof
Senior Member
Join Date: Nov 2004
Old 04-22-2006 , 15:54  
Reply With Quote #5

There 3 ways I can think to do what you are wanting to do.

1. If you can get nvault_delete function added

2. Log the person steam ID with const value of gaben and then check that value to set their global. When you want to remove them, set the value to something else. This will add more overhead though.

3. Read the timestamp for a certain entry and prune with that as your window. There is still a slight chance you could remove someone you didn't want to that was gabened at the exact same time. This may be the best option for actually removing the entry from the vault.

Code:
new temp[9] new delete_time, start_time, end_time nvault_lookup(vault , arg , temp , 8 , timestamp) delete_time = timestamp start_time = delete_time - 1 end_time = delete_time +1 nvault_prune (vault , start , end ) nvault_close(vault )

It's not all of the code, but the idea is there and nice and bunched up for you
slurpycof is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-22-2006 , 16:02  
Reply With Quote #6

I thought of doing #2 already. I guess I'll go with that. Thanks.
__________________
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 05:00.


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