Raised This Month: $ Target: $400
 0% 

Saving/Loading API for .ini/.cfg?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-13-2016 , 12:24   Re: Saving/Loading API for .ini/.cfg?
Reply With Quote #6

You have many options, easiest would be vault or nvault.

With regular vault (get_vaultdata, set_vaultdata, remove_vaultdata, vaultdata_exists), it is saved in plain-text format so you could go into amxmodx\data\vault.ini and see your saved values. The only thing you will need to do is prefix your key(s) with your plugin name or some other identifier so another plugin doesn't use your data. You cannot specify an individual vault file like nvault allows.
Code:
; Don't modify!
server_language	en
SomeNumber	28
ABCPluginTimeStamp	1452397473
ABCPluginStartDate	12/26/2015 22:44
ABCPluginEndDate	01/09/2016 22:44
With nvault, you can specify the vault file name so you do not need to differentiate your keys for your plugin. But, you do need to differeniate your keys if you are saving multiple types of data using the steam-id as a 'base key'. eg. XPPoints_STEAM_0:0:12345, Health_STEAM_0:0:12345. Or, you can use nvault_get/setarray from nVault Utility and save multiple data items under the same key.
__________________

Last edited by Bugsy; 02-13-2016 at 12:26.
Bugsy is offline
 



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:33.


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