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

Knowledgebase


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Plugin ID:
271
Plugin Version:
1.6
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows for arbitrary strings to be defined for keywords
    Old 02-03-2008 , 07:15   Knowledgebase
    Reply With Quote #1

    This plugin allows to store stuff which can be queried using chat commands, like a clan's homepage URL or small howtos.

    Commands:
    • ? <keyword>
      See the description for this keyword
    • ! <keyword> <description>
      Store a new description for this keyword (Chat admin level required)
    • kbase_list
      Lists all defined keywords (apart from SteamIDs)
    • kbase_delete <keyword>
      Deletes the description for the given keyword
    If you specify "me" as the keyword, the string will be stored/deleted using your SteamID. That way, every player can define their very own "me" string, which will also be displayed automatically as a welcome message.
    Your SteamID will not be printed in the Messages, it will be replaced with your name.

    CVars:
    kbase_version - guess what
    kbase_public - if 1, answers are displayed to everyone instead of just the person who asked the question.

    example:
    Code:
    ? knowledgebase
    [KB] Keyword not found.
    ! knowledgebase "cool stuff coded by Gee"
    [KB] Defined knowledgebase as "cool stuff coded by Gee".
    ? knowledgebase
    [KB] knowledgebase: cool stuff coded by Gee
    ! me "I am the Ubermensch!"
    [KB] Defined me as "I am the Ubermensch!"
    ? me
    [KB] MistaGee: I am the Ubermensch!
    All the data is stored in an SQL database, you need to have named configs "knowledgebase" or "default" for this to work. I've tested it to work both with MySQL and SQLite.


    Changes:
    1.6: Introduced kbase_delete
    1.5: Introduced kbase_list, made kbase_public 1 per default
    1.4: Special keyword "me" can be defined by every player, those defined are displayed publicly when players join (like chanserv does in irc)
    1.3: Bugfix - knowledgebase table was not created in SQLite
    1.2: Bugfix - forgot to call CloseHandle on the DB statements
    1.1: introduced kbase_public cvar

    MGee
    Attached Files
    File Type: sp Get Plugin or Get Source (knowledgebase.sp - 1717 views - 8.3 KB)
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble

    Last edited by MistaGee; 02-06-2008 at 20:05.
    MistaGee is offline
    Send a message via ICQ to MistaGee
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-03-2008 , 07:26   Re: Knowledgebase
    Reply With Quote #2

    Awesome I been waiting for something like this for ages.

    So if I did this:

    ! url "http://evil-twin.org.uk"

    and then

    ? url

    Would everyone on the server see the description?

    ^ that's what I really want ^
    __________________
    Extreme_One is offline
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-03-2008 , 07:27   Re: Knowledgebase
    Reply With Quote #3

    no, currently only the one who asked the question sees the answer, but I think I could easily change that...
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble
    MistaGee is offline
    Send a message via ICQ to MistaGee
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-03-2008 , 07:28   Re: Knowledgebase
    Reply With Quote #4

    Quote:
    Originally Posted by MistaGee View Post
    no, currently only the one who asked the question sees the answer, but I think I could easily change that...

    OK I'll wait and see if you can make the change to allow all to see the response.

    Can you also please explain what we need to put in "configs "knowledgebase" or "default"" and where they need to be saved.
    __________________

    Last edited by Extreme_One; 02-03-2008 at 07:33.
    Extreme_One is offline
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-03-2008 , 07:33   Re: Knowledgebase
    Reply With Quote #5

    Changed it, I didn't test it but I don't see any reason why it shouldn't work
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble
    MistaGee is offline
    Send a message via ICQ to MistaGee
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-03-2008 , 07:47   Re: Knowledgebase
    Reply With Quote #6

    Quote:
    Originally Posted by MistaGee View Post
    Changed it, I didn't test it but I don't see any reason why it shouldn't work
    Thank you MistaGee

    Before I install this, can you please go into a little more detail about the knowledgebase.cfg / default.cfg configs, where they need to go and the cvars we need to include.

    I see I'll be using kbase_public 1

    Does that go in cfg/sourcemod/knowledgebase.cfg ?
    __________________
    Extreme_One is offline
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-03-2008 , 07:58   Re: Knowledgebase
    Reply With Quote #7

    Quote:
    Originally Posted by Extreme_One View Post
    Can you also please explain what we need to put in "configs "knowledgebase" or "default"" and where they need to be saved.
    See the SourceMod wiki here for this (only the "configuration" section is relevant): http://wiki.alliedmods.net/SQL_Admin...#Configuration

    You only need to create the knowledgebase config if you don't have a default config or don't want them to be identical, so in most cases you'll just create a default config.

    If you don't have a MySQL db, use SQLite. It saves the whole database as a file somewhere on your server. It should work fine with this plugin, though I haven't tested it yet. Please let me know if you run into problems.
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble

    Last edited by MistaGee; 02-03-2008 at 08:04.
    MistaGee is offline
    Send a message via ICQ to MistaGee
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-03-2008 , 09:15   Re: Knowledgebase
    Reply With Quote #8

    Quote:
    Originally Posted by MistaGee View Post
    It should work fine with this plugin, though I haven't tested it yet.
    Now that I did test it, I actually found a problem: The table was not created correctly, apart from that it worked.

    I've fixed that in the latest version.

    Here's an example config, paste that into the "Databases" section in databases.cfg:
    Code:
    "knowledgebase"
    {
        "driver"              "sqlite"
        "database"            "knowledgebase"
    }
    Then, all your data will be stored in the file cstrike/addons/sourcemod/data/sqlite/knowledgebase.sq3.

    If you want a single db (file) to be used for all DB related stuff, just name the config section "default".

    Hth...
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble

    Last edited by MistaGee; 02-03-2008 at 09:18.
    MistaGee is offline
    Send a message via ICQ to MistaGee
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 02-03-2008 , 10:42   Re: Knowledgebase
    Reply With Quote #9

    Thanks.

    I'll give it a go.

    [edit]

    Hmm added the plugin to the plugins folder.
    Added the lines to create the SQlite database.
    Tested that the Knowledgebase plugin's loaded with: sm plugins list. The Knowledgebase plugin is loaded.
    Typed ? test in chat expecting to see [KB] Keyword not found. Nothing

    Tried to add a keyword .. nothing.

    :/
    __________________

    Last edited by Extreme_One; 02-03-2008 at 11:34.
    Extreme_One is offline
    MistaGee
    Senior Member
    Join Date: Aug 2004
    Location: Germany (Fulda)
    Old 02-03-2008 , 16:45   Re: Knowledgebase
    Reply With Quote #10

    How exactly did you try to add the string? If you use the chat, you'll need to prepend the command with a ! or /, like so:

    !? keyword

    I've registered ! and ? as regular commands, so the usual rules for commands apply to them as well

    If it still doesn't work then, please try from the server console and post error messages.
    __________________
    Ich hab nie behauptet dass ich kein Genie bin!
    Mumble-Django: A web interface for Mumble
    MistaGee is offline
    Send a message via ICQ to MistaGee
    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 16:00.


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