Raised This Month: $ Target: $400
 0% 

Vault, help?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-23-2005 , 07:49   Vault, help?
Reply With Quote #1

Alright, I've given up on MySQL totally.. Now here's my little test thing-a-ma-do.. But whenever I say "vault_test", it always comes up with "Vault data entered!". What I'm trying to do is check and see if the current data exists in the file, if it doesn't, then it enters a new line or whatever; if it does, it won't touch the current data. Thanks for the help. ;)
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Vault data test","0.1","v3x")     register_clcmd("say vault_test","Vault_Test") } public Vault_Test(id) {     new authID[30]     get_user_authid(id,authID,29)     new name[33]     get_user_name(id,name,32)     new vData[78]     format(vData,77,"%s_%s_1337",authID,name)     if(!vaultdata_exists(vData)) {         set_vaultdata(vData)         client_print(id,print_chat,"Vault data entered!")     }     else if(vaultdata_exists(vData)) {         //set_vaultdata(vData2)         client_print(id,print_chat,"Vault data already exists!")     }     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
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-23-2005 , 12:19  
Reply With Quote #2

a) You never actually used set_vaultdata

b) Why are you saving it with their name? o_O
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-23-2005 , 12:21  
Reply With Quote #3

a) Huh?

b) It's just a simple plugin to get me used to using Vault.

__________________
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
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-23-2005 , 15:04  
Reply With Quote #4

V3x.. you screwed up on this line here.. suprised you didn't get a missing parameter error:

set_vaultdata(vData)

what you need to do is save some data INTO the key vData. I would do it like this.

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Vault data test","0.1","v3x")     register_clcmd("say vault_test","Vault_Test") } public Vault_Test(id) {     new authID[30]     get_user_authid(id,authID,29)     new name[33]     get_user_name(id,name,32)     //adding here     new vKey[78]     format(vKey,77, "%s", authID)     //this ^^ will be your key (or reference)     new vData[78]     format(vData,77,"%s_%s_1337",authID,name)     //this ^^ will be the data you are actually saving     if(!vaultdata_exists(vData)) {         set_vaultdata(vKey, vData)//fixed this line, to save vData into vKey         client_print(id,print_chat, "User %s (SteamID %s) saved to vault!", name, authID)//adding a better msg lol     }     else if(vaultdata_exists(vData)) {         //set_vaultdata(vData2)         client_print(id,print_chat,"User %s (SteamID %s) already exists!", name, authID)//adding another better message :P         client_print     }     return PLUGIN_HANDLED }


That should fix it up for you
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-23-2005 , 16:29  
Reply With Quote #5

Oh, okay, rofl you did, you just didn't put anything into it. ;-) Nice catch Bio.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-23-2005 , 16:51  
Reply With Quote #6

Usually not too hard to find someone else's error. Just not your own lol
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-23-2005 , 20:57  
Reply With Quote #7

Damn Bio, you're doin good so far for a week of coding.. Thanks for the PM btw, I'll read it when my brain is more awake cause I just woke up.
__________________
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
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-23-2005 , 21:29  
Reply With Quote #8

Thanx done programming in VB and Java so that really helps. You just woke up? What time zone are you in? It's 90 here lol
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-23-2005 , 21:30  
Reply With Quote #9

Yep, 90 here, too. I pulled an all-nighter, then fell asleep (not WENT to sleep!) around 3ish.
__________________
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
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-23-2005 , 21:42  
Reply With Quote #10

lmao, i was up till about 30 and up around 2:00... 11 hours is enough for me
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
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 09:55.


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