Raised This Month: $ Target: $400
 0% 

Adt Arrays vs. KeyValues (few data)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pilger
Senior Member
Join Date: Sep 2010
Old 05-02-2015 , 22:38   Adt Arrays vs. KeyValues (few data)
Reply With Quote #1

Hey guys,


I'm coding a dynamic menu plugin that works somewhat like adminmenu.sp. It basically rely on a KeyValue file such as this:
Code:
"Adm"
{
    "vote"
    {
        "cmd1"
        {
            "cmd"        "votecmd1"
            "target"    "player"
            "question"    "pick a player"
        }
        "cmd2"
        {
            "cmd"        "votecmd2"
            "target"    "player"
            "question"    "pick a player"
        }
        "cmd3"
        {
            "cmd"        "votecmd2"
            "target"    "player"
            "question"    "pick a player"
        }
    }
    "action"
    {
        "mute"
        {
            "cmd"        "mute %s"
            "target"    "player"
            "question"    "pick a player"
        }
    }
}
This should create an admin menu with custom categories (e.g.: "Vote") and items (e.g.:"cmd1").

My question is about how should I store this data after parsing the kv file. The plugin would have to acess this info everytime someone opens up the menu. So should I stick to the kv structure and keep jumping back and forth to acess the data or should I send it all to an adt_array and drop the kv structure?

I guess this question is more theoretical than practical, since for such a small ammount of data, it wouldn't matter much which one I do. I'd like to know the best way to do it anyway. For the sake or learning and maybe applying on a future situation.
__________________
pilger 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 09:01.


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