Saving/Loading API for .ini/.cfg?
Hello, is there a api or plugin example for saving/loading with a file (ini/cfg) ?, just like nvault for example.
|
Re: Saving/Loading API for .ini/.cfg?
Mhmm... for loading cvars, or file paths, such as sounds/sprites/models there is an API in zp 5.0, called amx_settings_api
For saving data per player and stuff, i recommend nvault or sql |
Re: Saving/Loading API for .ini/.cfg?
Quote:
There was an API for mysql, but i forgot who posted it, and i cannot find it. I already make a plugin that saves a value successfully after changing map. via CFG. Im not sure if i will use it. |
Re: Saving/Loading API for .ini/.cfg?
Quote:
|
Re: Saving/Loading API for .ini/.cfg?
Mysql api is under your nose, I mean look into admin.sma , it has defined MySQL for loading and saving admins. =)
|
Re: Saving/Loading API for .ini/.cfg?
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! |
Re: Saving/Loading API for .ini/.cfg?
So nvault looks like what you were looking for... it is also easy to use
Plus you will never run into trouble with it as long as bugs is around, believe me, he can make it cook even pancakes |
Re: Saving/Loading API for .ini/.cfg?
The thing with nvault is it is saved in binary format so you cannot read/modify the data in a text editor. You need to use an nvault editor for this (see signature). I'm not sure if this matters to you or not.
|
Re: Saving/Loading API for .ini/.cfg?
There are INI and SMC (SourceMod Configuration format) parsers in 1.8.3-dev version, if you are willing to use it.
I believe Mercylezz published his INI parser as a standalone plugin around here. Also, writing your own "key=value" parser shouldn't be difficult at all. |
| All times are GMT -4. The time now is 09:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.