Raised This Month: $ Target: $400
 0% 

Vaults and such


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 04-28-2004 , 21:57   Vaults and such
Reply With Quote #1

currently im trying to make a plugin that uses a vault to store information. First of all, I know I need to use customdir. Also I need to figure out how to store and retrieve info. I want to try to store there steamids and get there info from it, plz help me out!
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
tla-nick
Junior Member
Join Date: Mar 2004
Location: Bradford UK
Old 04-30-2004 , 16:41  
Reply With Quote #2

Acording to addons/amxx/configs/core.ini the vault file (vault.ini) is addons/amxx/configs/vault.ini, you don't need to create your own although you could if you wanted to .

As for using the vault, it's pretty simple, you'll need to #include the vault include file, and there are four vault functions (read,write,remove,exists?).

Eg:
Code:
#include <vault> /* store client's name in vault, indexed by authid, if they already have name in vault, extract it first */ storeName(id) {   new newName[32], oldName[32] authid[32]   get_user_name(id,newName,31)   get_user_authid(id,authid,31)   if (vaultdata_exists(authid))     get_vaultdata(authid,oldName,31)   set_vaultdata(authid,newName) } /* remove client data from vault on disconnect */ public client_disconnect(id) {   new authid[32]   get_user_authid(id,authid,31)   if (vaultdata_exists(authid))     remove_vaultdata(authid) }
__________________
Where did you want to be, the day before yesterday?

- Another Disgruntled Microsoft User
tla-nick is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 05-01-2004 , 09:17   hmmm
Reply With Quote #3

Ok, that really helped me out, now I just need to ask one more thing, how could I store there authid's then store something else, like how many frags they left with, or something of that matter?
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Lt Llama
Senior Member
Join Date: Aug 2004
Old 08-15-2004 , 18:26   hmmm #2
Reply With Quote #5

I found this thread and thought it might be a way to handle my plugin request.

I want it to read and write to the vault file. This piece of code compiles but i get a bad load.
L 08/15/2004 - 22:55:01: [AMXX] Plugin file open error (plugin "firstvisit").

Are there any obvious errors in the code that you can see?

Code:
#include <amxmodx> #include <vault> public plugin_init(){     register_plugin("First Visit","0.1","originally tla-nick") } /* store client's name in vault, indexed by authid, if they already have name in vault, extract it first */ public storeName(id) {   new newName[32], oldName[32], authid[32]   get_user_name(id,newName,31)   get_user_authid(id,authid,31)   if (vaultdata_exists(authid))     get_vaultdata(authid,oldName,31)   set_vaultdata(authid,newName)   return PLUGIN_CONTINUE } /* remove client data from vault on disconnect */ public client_disconnect(id) {   new authid[32]   get_user_authid(id,authid,31)   if (vaultdata_exists(authid))     remove_vaultdata(authid)   return PLUGIN_CONTINUE }
Lt Llama 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 07:03.


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