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

How to make a plugin read data from a config file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nomarky
SourceMod Donor
Join Date: Sep 2007
Old 07-06-2008 , 11:55   How to make a plugin read data from a config file
Reply With Quote #1

Hi

I have made a little plugin that prints some info to chat when a client joins, mostly about chat triggers/features etc. Currently the messages are hard coded into the plugin, but I would like them to be read from a file instead. Could anyone give me some pointers on how to do this?

Cheers!
Nomarky is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 07-06-2008 , 12:37   Re: How to make a plugin read data from a config file
Reply With Quote #2

http://docs.sourcemod.net/api/index.php

Take a look at the "files" section. You'll find most of what you're looking for there.
bl4nk is offline
BAILOPAN
Join Date: Jan 2004
Old 07-06-2008 , 12:43   Re: How to make a plugin read data from a config file
Reply With Quote #3

If you still want to hardcode the phrases, but allow for translating, see translating.

If you want just normal file parsing, you can use KeyValues API (keyvalues.inc) which is Valve's format for config files, or just normal file reading (files.inc).
__________________
egg
BAILOPAN is offline
Nomarky
SourceMod Donor
Join Date: Sep 2007
Old 07-07-2008 , 15:41   Re: How to make a plugin read data from a config file
Reply With Quote #4

Thanks guys, I'll take a look
Nomarky 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 01:37.


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