Raised This Month: $ Target: $400
 0% 

I need help in Saving Data :P


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 01-06-2008 , 00:41   I need help in Saving Data :P
Reply With Quote #1

This is the only thing i didnt care to learn about lol.
anyways how can i save data, for example
"2 xp for each headshot made"
"1 xp for each kill made"
and then they can be loaded and saved in valut or a separate file
and i can just type "/xpstats"
then a hud will tell me how much xp i have or a MoTD

Is there any recent tutorials? or can someone show me how to do this?

thank you
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
taheri6
Member
Join Date: Mar 2006
Old 01-06-2008 , 02:21   Re: I need help in Saving Data :P
Reply With Quote #2

This isnt a tutorial, but you can look here
http://forums.alliedmods.net/showthr...highlight=SQLX

This one isnt recent, but its still very relevant. I used this to convert uwc3 mod to sqlx from the old DBI

http://forums.alliedmods.net/showthread.php?t=46779
__________________
http://www.yaur.com -=[Yaur]=- Clan Website
taheri6 is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 01-06-2008 , 02:38   Re: I need help in Saving Data :P
Reply With Quote #3

Thanks for replying
well mostly what im asking for is a tutorial that can tell me how i can code plugins and save them in Nvault or something
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
taheri6
Member
Join Date: Mar 2006
Old 01-06-2008 , 04:16   Re: I need help in Saving Data :P
Reply With Quote #4

Check into this for SQLite
http://forums.alliedmods.net/showthr...ghlight=SQLite
__________________
http://www.yaur.com -=[Yaur]=- Clan Website
taheri6 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 01-06-2008 , 04:35   Re: I need help in Saving Data :P
Reply With Quote #5

Quote:
Originally Posted by flyeni6 View Post
Thanks for replying
well mostly what im asking for is a tutorial that can tell me how i can code plugins and save them in Nvault or something
I don't think there is one. But it's not that hard.
Code:
#include <amxmodx> #include <nvault> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "Drak" new g_Vault public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)             /*     * It's best to open a vault on plugin start     * and close it on "plugin_end"     * This also creates a vault file in "amxmodx/data/vault" automatically.     */     g_Vault = nvault_open("my_vault"); } SaveSomeInfo(id) {     //Save some random info, by a players SteamID     new SteamID[36]     get_user_authid(id,SteamID,35)         // The vault file would now hold a value similar to this:     // STEAM_ID_BLAH 123     nvault_set(g_Vault,SteamID,"123"); } // Let's load what we just saved LoadSomeInfo(id) {     new SteamID[36]     get_user_authid(id,SteamID,35);         // If the key was found, continue.     if(nvault_lookup(g_Vault,SteamID,data,255,timestamp))     {         new AuthID[36],Value[33]         parse(data,AuthID,35,Value,32);                 new ValueNum = str_to_num(Value);                 // AUTHID would return are saved SteamID         // ValueNum now holds "123"         // Value holds the string "123"     }     // No Data was found with that key     else     {     } } public plugin_end()     nvault_close(g_Vault);
It's commented.. Kinda.. It might help some.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 01-06-2008 , 18:24   Re: I need help in Saving Data :P
Reply With Quote #6

thanks ill add some more code to what you did and post it here to see if it is good enough
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Reply


Thread Tools
Display Modes

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 11:05.


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