Raised This Month: $32 Target: $400
 8% 

Introduction to vaults


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jon
Veteran Member
Join Date: Dec 2007
Old 12-25-2008 , 19:34   Introduction to vaults
Reply With Quote #1

So I'm total new to vaults and I've decided to use FVault since PS uses it. I just need a little kick in the ass to understand how it works, things are so much easier with examples. So if someone could give me a little example which contains this:
  • Create the vault
  • Save a players steamid and name
  • Retrive the info
It would have been extremely helpful. And btw, where did those crabs come from? :O
Jon is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-25-2008 , 23:24   Re: Introduction to vaults
Reply With Quote #2

You could use PointSystem plugin as an example.

Code:
#include <amxmodx> #include <amxmisc> #include <fvault> new const g_vault_name[] = "test_vault"; new g_name[33][35]; new g_steamid[33][35]; public client_authorized(client) {     get_user_authid(client, g_steamid[client], sizeof(g_steamid[]) - 1);         if( !LoadUserName(client) )     {         get_user_name(client, g_name[client], sizeof(g_name[]) - 1);         SaveUserName(client);     }         client_print(0, print_chat, "%s has connected!", g_name[client]); } public client_disconnect(client) {     if( !g_steamid[client][0] )     {         // client disconnected before authorizing         return;     }         client_print(0, print_chat, "%s has disconnected!", g_name[client]);         g_name[client][0] = 0;     g_steamid[client][0] = 0; } LoadUserName(client) {     return fvault_get_data(g_vault_name, g_steamid[client], g_name[client], sizeof(g_name[]) - 1); } SaveUserName(client) {     fvault_set_data(g_vault_name, g_steamid[client], g_name[client]); }

This code saves the player's name that the player used the first time they joined the server, and prints it to everyone when the player [dis]connects.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 12-26-2008 , 09:15   Re: Introduction to vaults
Reply With Quote #3

Thanks alot, working on the plugin now

Still, where did the crabs come from?
Jon 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 03:46.


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