OfficerJohnson Posted January 18, 2018 Share Posted January 18, 2018 Hello all. I'll get straight to it. Researching scripts, I'm noticing very few do not have INI files. Currently, I'm focusing on keyboard (hotkey) scripts but eventually would like to transition to INIs. My main programming/scripting methods are LUA and .NET (learning how it works). How does one create an INI for a script? Is it only used to store values? Is it necessary? Link to comment Share on other sites More sharing options...
Bob_74 Posted January 18, 2018 Share Posted January 18, 2018 (edited) INI files allow the player to edit some of the values you use in your mod. For example, if you make a trainer which add you money every time you hit the M key, you have two choices: A: You set the amount of money in your script and the player cannot choose it. B: You read the value from an external file which is editable by the player (we often use INI files, .NET want us to use XML files now). Read this topic to see how you can handle INI files with ScriptHookV.NET (it's very helpful!): http://gtaforums.com/topic/827982-about-ini-file/?p=1068131901 Edited January 18, 2018 by Bob_74 OfficerJohnson 1 Link to comment Share on other sites More sharing options...
Jitnaught Posted January 18, 2018 Share Posted January 18, 2018 (edited) How to create them is always the same: write it manually. How to access them is different in each language. In C++ you would have to either use GetPrivateProfileString or a 3rd party INI library. In .NET (C#/VB) you would either use SHVDN's implementation, PInvoke GetPrivateProfileString, or use a 3rd party INI library. I'm unaware of if RagePluginHook has a INI implementation or not, but I'd guess not. Read reply below for RagePluginHook INI implementation. SHVDN's implementation can be used like this: Settings.GetValue("SECTION", "NAME", "DEFAULT_VALUE"); In LUA you would have to use a 3rd party INI "library", of which there are many. Yes it's used to store data that the user can change, like keybinds and stuff. It is not necessary (especially for scripting languages like LUA) but can be very useful for users and the like. Edited January 18, 2018 by Jitnaught OfficerJohnson 1 Link to comment Share on other sites More sharing options...
alexguirre Posted January 18, 2018 Share Posted January 18, 2018 RAGEPluginHook has an INI implementation, the InitializationFile class. Jitnaught and OfficerJohnson 2 Link to comment Share on other sites More sharing options...
OfficerJohnson Posted January 18, 2018 Author Share Posted January 18, 2018 Thank you all for your replies. Jitnaught 1 Link to comment Share on other sites More sharing options...