Raised This Month: $ Target: $400
 0% 

Reading Configs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Acid07
Member
Join Date: May 2009
Old 05-08-2010 , 17:03   Reading Configs
Reply With Quote #1

hey.

I would like to create a plugin which will read levels via a config file (in this case called "levels.cfg". for example the one below:

Code:
"Levels"
{
    "Steam ID here"
    {
        "level"        "Level Number from 0 to 99"
    }
}
i would basicly like to check what level the player is and send the level of the player who called it to a variable to run an if function on it.

The code alone would be nice however an annotated version would be nice too... so i can learn from it.

Cheers and thanks in advance.
Acid07 is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-08-2010 , 17:33   Re: Reading Configs
Reply With Quote #2

See this page for more info:

http://wiki.alliedmods.net/KeyValues...d_Scripting%29
__________________
Scone is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 05-08-2010 , 18:48   Re: Reading Configs
Reply With Quote #3

If you're storing player settings I recommend using the clientprefs API (see clientprefs.inc), where you can save and read client cookies. Clientprefs can be configured to use a MySQL database which is a must if there are a lot of players.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
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 08:29.


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