View Single Post
Plugin Info:     Modification:          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 - 2064 views - 63.8 KB)
File Type: rar dbi_clan_manager_other_files.rar (1.0 KB, 835 views)
File Type: rar dbi_sql_files.rar (634 Bytes, 804 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