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

DBI Clan Management for Amxmodx Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:          Approver:   EKS (166)
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 04-26-2005 , 17:14   DBI Clan Management for Amxmodx Commands
Reply With Quote #1

This is a mod inspecific Clan Management System for Admins who are busy, and dont need the hastle of managing their clan flags for amxmodx. It will handle any number of Clans / Ranks / Members. In brief its easy, once its setup. It takes a bit to setup and I am working on a Web Interface for it but at the moment do NOT have the time to complete it. Help in this area would be appreciated. Ok to details:

Instructions:
1) You MUST have a DBI.
2) You MUST enable the dbi in you modules.ini
3) You MUST put in the proper information in your sql.cfg

Installation:
1) Once you have created your DB in lets say MySQL you must install the clanmanager.sql (For further info ask somewhere else plz)
2) Next you must edit the clanmanager_inputs.sql to suit your clan (I have provided a demo version to go with this plugin)
2a) If your editing it you will notice that there are alot of '(s)' these denote spaces within the clan tag. So lets say your a General, and your clan tag is |BW| and your name is Zor, the plugin will autorename you when you join the server, if enabled, to the following: |BW| Gen Zor, what its actually seeing is the following: |BW|(s)Gen(s)Zor, and will repace the (s) with white space. so you must take care in your setup before installing it to your DB. Ok so lets get into the examples.

First the Clan Definition:
Code:
INSERT INTO clan_manager_clans VALUES (1, 'The Generic Clan', 'Generic Clan', '[GC](s)', '(s)|UC|', 1);
Lets break it down:
VALUES (
// This is the Reference for this clan, first one
1,
// This is the Full Clan Name
'The Generic Clan',
// This is the Clan Tag
'[GC]',
// What goes in front of the player name
'[GC](s)',
// What goes in after the player name
'(s)|UC|',
// Position of the rank in the group, it starts at 0
1);

So for this generic clan the result would look like this:
[GC] (Rank) PlayerName |UC|

Next lets go over the Clan Ranks:
Code:
INSERT INTO clan_manager_levels VALUES (1, 24, 'General', '(s)(Gen)', 'abcdefghijkmnopqrsltu');
Lets break it down:
VALUES (
// This is the clan this Rank is associated with
1,
// This is the index of this Rank
24,
// This is the full name of the Rank
'General',
// This is the short name of the Rank
'(s)(Gen)',
// These are the Amxmodx Flags this Rank is Granted
'abcdefghijkmnopqrsltu');

Now you HAVE to ensure to edit these appropriately.

Lastly we will go over the Clan Members:
Code:
INSERT INTO clan_manager_members VALUES ('STEAM_0:0:000000', 'John(s)Doe', 1, 24, NOW(), NOW(), '0', '0', '', '1');
Lets break it down:
VALUES (
// Duh! Hehehe
'STEAM_0:0:000000',
// This is the members name WITHOUT clan stuff
'John(s)Doe',
// This is the clan he belongs too
1,
// This is his Rank Reference, in this case General
24,
// When did he join the clan
NOW(),
// When was the last time he was on a clan server
NOW(),
// Is he a webadmin (Stub for Now)
'0',
// Level of webadmin (Stub for Now)
'0',,
// His Webadmin Password (Stub for Now)
'',
// Is he an active member
'1');

Remember...you DO NOT NEED TO SETUP MEMBERS THIS WAY! You can wait untill they are on the server and use the clan_menu Menu to add ppl and assign them a Rank.

So putting it all for our demo. John Doe joins the server, it looks at his Steam ID and then determines what clan he is in, what rank he is, and then assigns the Amxmodx Flags respective of his rank to him. And then if enabled it will then rename him, great for those automatic promotions, or sill pricks that like to play on the server with a pseudo name, ick...so in this regard the Player will get named the following:

Quote:
[GC] (Gen) Joh Doe |UC|
So, all in all thats about sums it up. Once point you can leave ppl in the users.ini if you wish...just make sure that this plugin is placed IMEDIATELY after the admins.amxx in your plugins.ini.

Question let me know in this thread!

Versioning:
Quote:
v0.1
- Be!
v0.2
- Added change info and moved the actuall check of user into a function of its own
v0.2a
- Changed all the LIKE to RLIKE for regular expresions, added server_print so that if called from console the caller gets some info on whats up
v0.2b
- Fixed the sql setup to eliminate all the redundant connections to the sql server
v0.2c
- Fixed it so that on the demote and promote it will tell the rank name not the number
v0.2d
- Added the NOW() for last time they connected
v0.2e
- Added setting a clan member to a certian level
- Fixed up the sql result calls
- Added first join in the member add
- Fixed error with the names with spaces in them not renaming correct
v0.3
- Added menus, at this moment they are looping, not sure why. Will continue testing
v0.3a - Menus are working
v0.4 - Worked on the sql connection area and now only have one connect instead of a bunch.
v0.5 - Fixed errors with dbi_num_rows
v0.5a - Added clan_listmembers, and clan_active as well as menus for the clan_active
ToDo:
Quote:
- Get a working web interface for this
CVARS:
Code:
clan_force_rename "0"
clan_replace_delim "(s)"
clan_replace_with " "
clanmanagerdebug "1"
Attached Files
File Type: sma Get Plugin or Get Source (dbi_clanmanager.sma - 2050 views - 63.8 KB)
File Type: rar dbi_clan_manager_other_files.rar (1.0 KB, 827 views)
File Type: rar dbi_sql_files.rar (634 Bytes, 800 views)
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 04-26-2005 , 17:58  
Reply With Quote #2

For those of you interested in a text version of this plugin

http://forums.alliedmods.net/showthread.php?t=4092

BE AWARE IT IS NOT PERFECT AND IS NOT SUPPORTED.

Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Revolution
Member
Join Date: Apr 2005
Old 05-10-2005 , 18:36  
Reply With Quote #3

Haven't tried it yet, but it looks very usefull... Just wondering if you could use the same mysql database for more then one server..... I don't think this should be a problem, just wondering if anyone has tried it.....

Revolution
__________________
Revolution is offline
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 05-11-2005 , 03:32  
Reply With Quote #4

wooh zor
another great plugin from you!! damn this looks really nice

damn If I only knew a little php I could help you ..hmm I relaly gotta learn some..
thank you!!
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 05-11-2005 , 10:30  
Reply With Quote #5

@Revolution

You can store as many clans in the one DB as you want. Billlionssss...well you get the idea. I at the moment have 3 clans stored in my DB. 1 is my clan, the second is a loose conglmerate of ppl that wear the [RATZ] tag at the end of their name, they have no admin on the server, but it names the, with the tag. The last is a friend clan who again has no admin, but is easy to add cause I did it for them.

@proach
Thanks for the kind words. I did kinda have an interface for it. But I wanted it to be secure and I just dont have time to do it up. What I have been trying to complete is an easy to use website content management system that would be for clans who use Amxmodx. This CMS would house real time stats, clan management, ban managament (Basic), a News Front page, phpbb forums, and be very versatile and allow developers to develop modules for it real easy. So far time is my enemy as well as making the code SUPER EASY!!! So even ppl who know little about php can use this and develop modules for it. Anyway! Anyone fit this bill let me know!
Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 05-11-2005 , 10:41  
Reply With Quote #6

Quote:
@proach
Thanks for the kind words. I did kinda have an interface for it. But I wanted it to be secure and I just dont have time to do it up. What I have been trying to complete is an easy to use website content management system that would be for clans who use Amxmodx. This CMS would house real time stats, clan management, ban managament (Basic), a News Front page, phpbb forums, and be very versatile and allow developers to develop modules for it real easy. So far time is my enemy as well as making the code SUPER EASY!!! So even ppl who know little about php can use this and develop modules for it. Anyway! Anyone fit this bill let me know!
Cheers!

w00h now that is what I called ambitious!, maybe you should work together with some other mods (for example JGHG cause of his forum mod ) and some l33t php'er ( I though devicenull was a good php scripter?)
anyway you probably figured that out yourself.. hmm I can be beta tester or so? nothing much more I can do I guess since Im an endless n00b at coding and stuff
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
Revolution
Member
Join Date: Apr 2005
Old 05-18-2005 , 12:33  
Reply With Quote #7

OK installed pluggin, and I'm getting errors in server console.

1. Couldn't exec custom.cfg
I have custom.cfg installed in mod/addons/amxmodx/data/lang/

2. Couldn't exec sql.cfg
I have sql.cfg installed in mod/addons/amxmodx/config/

It sounds looks like it is not finding the .cfg files.
before installing plugin, I was running admin_sql.amxx and it worked fine. I created the for clan_manager tables in the same database as the admin_sql, commented out admin_sql.amxx in the plugins.ini and added the clanmanager.amxx.

Any Ideas on why they aren't executing?

Thanks
Revolution
__________________
Revolution is offline
Revolution
Member
Join Date: Apr 2005
Old 05-18-2005 , 13:36  
Reply With Quote #8

OK, Nevermind. I moved those files to the mod/ directory and they execute now, However I am now having problems in game, the Menu seams to be looping.

When the server is first started, I type clanmenu in the game console, and it says unknown command, I close the console and the menu is there. I press 1 to add a player It brings up a list of players in the server, I select the player, then it asks for the clan, I select the clan, and then the menu disapears. However that player is not added to the database. When I bring up the menu again, it doesn't matter what option I chose (except 0), it brings up the main menu again.

I have added one clan, several ranks, and several members to the DB, and the admin and the naming part works, ie: when I log on the server with a different name, it changes my name, and gives me admin.... but the adding users or changing users in game doesn't seem to be working.

I have to say I am very impressed with your coding Zor, It seems to be very clean, and effective. I am looking forward to the Web-Interface.

Revolution
__________________
Revolution is offline
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 05-18-2005 , 18:32  
Reply With Quote #9

Quote:
1. Couldn't exec custom.cfg
I have custom.cfg installed in mod/addons/amxmodx/data/lang/

how the fuck did you think of that..? a cfg in the lang folder..

did you putted it in the configs folder?
maybe that works (not sure )
and are you sql settings al set up good in sql.cfg?[/small]
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
Revolution
Member
Join Date: Apr 2005
Old 05-18-2005 , 19:11  
Reply With Quote #10

Quote:
how the fuck did you think of that..? a cfg in the lang folder..
up above where you dl the ClanManager_Other_Files.zip (wich has the custom.cfg file in it) it says "Dictionary file install here: mod/addons/amxmodx/data/lang/ so I put everything that was in that zip in that folder... no where did it say to put it anywhere else...
Quote:
did you putted it in the configs folder?
maybe that works (not sure )
I already had a sql.cfg file in the configs from when I was using admin_sql apperantly the plugin doesn't look in the config folder for the sql.cfg

Like I said I figured it out. I put both of them in the mod/ folder and it worked.
Quote:
and are you sql settings al set up good in sql.cfg?
Duh!!!! if it gives me admin and changes my name to whats in the db, I think it is set up right

Revolution
__________________
Revolution 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 21:43.


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