Raised This Month: $12 Target: $400
 3% 

Creating new .ini file


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-28-2019 , 19:26   Re: Creating new .ini file
Reply With Quote #11

You can store anything, it works the same way as an ini file, using a key/value format. The only thing you are missing is the sections of settings, which you can handle by naming your keys appropriately. And of course, this is a binary file so no text editor editing.

Code:
[Section]
setting=value

PHP Code:
nvault_setvault "setting" "value" )

nvault_getvault "setting" szValue charsmaxszValue )
OR
iVal nvault_getvault "setting" 
__________________
Bugsy is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 05-28-2019 , 20:21   Re: Creating new .ini file
Reply With Quote #12

Quote:
Originally Posted by Bugsy View Post
You can store anything, it works the same way as an ini file, using a key/value format. The only thing you are missing is the sections of settings, which you can handle by naming your keys appropriately. And of course, this is a binary file so no text editor editing.

Code:
[Section]
setting=value

PHP Code:
nvault_setvault "setting" "value" )

nvault_getvault "setting" szValue charsmaxszValue )
OR
iVal nvault_getvault "setting" 
Ah, but what about quick editing the settings? You'd have to recompile (unless using cvars of course). Having a ready .ini file, which is more optimal and requires you to only open it and change its parameters. With cvars, no, nvault is definitely a better solution, but let's say I wanted to add/remove player classes for the next map. Editing an .ini file is better and faster than recompiling the whole code.
redivcram is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-28-2019 , 20:57   Re: Creating new .ini file
Reply With Quote #13

Exactly, this is why I mentioned (3 times) that you cannot use a text editor which is a no-go for some. You could create commands in your plugin to edit the settings, which is easier than opening notepad to do so--but that's just me.
__________________

Last edited by Bugsy; 05-28-2019 at 20:58.
Bugsy is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 05-29-2019 , 05:47   Re: Creating new .ini file
Reply With Quote #14

Quote:
Originally Posted by Bugsy View Post
Exactly, this is why I mentioned (3 times) that you cannot use a text editor which is a no-go for some. You could create commands in your plugin to edit the settings, which is easier than opening notepad to do so--but that's just me.
Again, not for all cases, text files are more optimal.

Edit: After renewal of my knowledge about nVault, I've learned a lot more of what it can do, so I'd ditch the textual files. LOL

Last edited by redivcram; 05-29-2019 at 07:25.
redivcram is offline
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 15:21.


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