AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Knowledgebase (https://forums.alliedmods.net/showthread.php?t=66572)

MistaGee 02-03-2008 07:15

Knowledgebase
 
9 Attachment(s)
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 :P
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

Extreme_One 02-03-2008 07:26

Re: Knowledgebase
 
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 ^ :)

MistaGee 02-03-2008 07:27

Re: Knowledgebase
 
no, currently only the one who asked the question sees the answer, but I think I could easily change that...

Extreme_One 02-03-2008 07:28

Re: Knowledgebase
 
Quote:

Originally Posted by MistaGee (Post 581180)
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. :up:

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

MistaGee 02-03-2008 07:33

Re: Knowledgebase
 
Changed it, I didn't test it but I don't see any reason why it shouldn't work :D

Extreme_One 02-03-2008 07:47

Re: Knowledgebase
 
Quote:

Originally Posted by MistaGee (Post 581185)
Changed it, I didn't test it but I don't see any reason why it shouldn't work :D

Thank you MistaGee :mrgreen:

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 ?

MistaGee 02-03-2008 07:58

Re: Knowledgebase
 
Quote:

Originally Posted by Extreme_One (Post 581181)
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.

MistaGee 02-03-2008 09:15

Re: Knowledgebase
 
Quote:

Originally Posted by MistaGee (Post 581191)
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...

Extreme_One 02-03-2008 10:42

Re: Knowledgebase
 
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.

:/

MistaGee 02-03-2008 16:45

Re: Knowledgebase
 
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.


All times are GMT -4. The time now is 18:25.

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