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

About Link Up the .ini Files to Plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jess98
Junior Member
Join Date: Apr 2018
Old 11-15-2018 , 08:56   About Link Up the .ini Files to Plugins
Reply With Quote #1

I want to learn how to link up the .ini files to plugins.. I had looked a lot of plugins which have a connect with .ini files, but didn't get the logic as well.

Is there any in-line explanation or example that explains this process?
Jess98 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 11-15-2018 , 11:30   Re: About Link Up the .ini Files to Plugins
Reply With Quote #2

Example1: https://forums.alliedmods.net/showthread.php?t=152802
Tutorial : https://forums.alliedmods.net/showthread.php?t=46218
instinctpt1 is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 11-15-2018 , 11:36   Re: About Link Up the .ini Files to Plugins
Reply With Quote #3

There's now a function called AutoExecConfig in AMXX, which should take care of all the logic itself.
http://www.amxmodx.org/api/amxmodx/AutoExecConfig
Kushfield is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-17-2018 , 14:49   Re: About Link Up the .ini Files to Plugins
Reply With Quote #4

Quote:
Originally Posted by Kushfield View Post
There's now a function called AutoExecConfig in AMXX, which should take care of all the logic itself.
http://www.amxmodx.org/api/amxmodx/AutoExecConfig
That's for .cfg files. For .ini files there's a built-in INI Parser, but I prefer a custom made reading system.
You can have a look at my plugins that use .ini files for a working example.
__________________

Last edited by OciXCrom; 11-17-2018 at 14:49.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Jess98
Junior Member
Join Date: Apr 2018
Old 11-23-2018 , 06:33   Re: About Link Up the .ini Files to Plugins
Reply With Quote #5

I understood a little bit but can anyone make a simple example?
Jess98 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-23-2018 , 07:42   Re: About Link Up the .ini Files to Plugins
Reply With Quote #6

Try to do it yourself and post what you have done and explain what the problem is.
__________________

Last edited by OciXCrom; 11-23-2018 at 07:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-24-2018 , 04:51   Re: About Link Up the .ini Files to Plugins
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
That's for .cfg files. For .ini files there's a built-in INI Parser, but I prefer a custom made reading system.
You can have a look at my plugins that use .ini files for a working example.
The SMC Parser (if that's what you're talking about) is not that easy to understand especially for newbies it might be very hard. Also, there are absolutely no tutorials on how to use it and haven't seen a plug-in using the SMC. There's 1 on SourceMod, and that's the admin plug-in. Other than than, I guess, on SM, ppl use KeyValues. So there's not rly much about learning SMC, just looking on the testinclude folder and trying to understand yourself how it works.
DarthMan is offline
Jess98
Junior Member
Join Date: Apr 2018
Old 11-24-2018 , 07:29   Re: About Link Up the .ini Files to Plugins
Reply With Quote #8

For a little example, I want to make a mapchooser. How can I read and administer datas in the .ini file that I use in my plugin? And please, explain without hard Amx Mod X phrases. I can't get everything 'cuz I'm a newbie.

This is my start code:

Code:
#include <amxmodx>

new const MAP_FILE[] = "maps.ini" // Creating the .ini file

public plugin_init() {

       register_plugin("Example", "1.0", "No One")         
}
Jess98 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 11-24-2018 , 08:43   Re: About Link Up the .ini Files to Plugins
Reply With Quote #9

Code:
ReadFile(PathToFile[])
{
new File = fopen(PathToFile, "rt");
new Buffer[128], A[128], B[128];
while (!feof(File))
{
fgets(File, Buffer, charsmax(Buffer));

if (!Buffer[0] || Buffer[0] == '#')
continue;

remove_quotes(Buffer);
strtok(Buffer, A, charsmax(A), B, charsmax(B), '=');
trim(A);
trim(B);

//A=Key
//B=Value
}

fclose(File);
}
/not tested/
/i have not implemented sections, i think that is too much for simple ini files/
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 11-24-2018 at 08:46.
Ghosted is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-25-2018 , 05:55   Re: About Link Up the .ini Files to Plugins
Reply With Quote #10

amx_settings_api
__________________








CrazY. is offline
Reply



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 12:51.


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