AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S] Gangs Mod - Jailbreak (https://forums.alliedmods.net/showthread.php?t=219638)

Eden.Campo 07-01-2013 05:36

[CS:S] Gangs Mod - Jailbreak
 
1 Attachment(s)

Gangs Mod - Jailbreak


Description:
Use this mod to create and rule Gangs in your servers. I've created this mod because I saw that only one mod like this exists, and it's abandoned by the author.


Requirements:
MySQL System
Store

Features:
* Create and Disband Gangs
* Invite or Expel Gang Members
* Unlimited Slot expension(controlable by CVar)
* Gang Banks
* Gang Ranks(supports Custom Ranks)
* Gang Bonuses(Guns, Armor, Health, Grenades etc.)
* Gang Privacy(Public or Private Gangs)
* Gang Admin Menu
* Gang Disband Passwords


Installation::

Download the attached zip archive and extract to your sourcemod folder. Then navigate to your configs/ directory and add the following entry in databases.cfg:

Code:

"gangs"
{
    "driver"        "mysql"
    "host"          "<your-database-host>"
    "database"      "<your-database-name>"
    "user"          "<username>"
    "pass"          "<password>"
}

Next, navigate to configs/gangs/sql-init-scripts and execute gangs.sql in your database

ConVars:

Code:

// Use Gang Banks? 1 = Yes, 0 = No
// -
// Default: "1"
gangs_bank "1"

// Decides how much credits will it cost to upgrade a bonus
// -
// Default: "1500"
gangs_bonus_upgrade_credits "1500"

// Decides how much credits will it cost to change a gang name
// -
// Default: "1000"
gangs_changename_credits "1000"

// Decides how many credits you need to create a new Gang
// -
// Default: "1500"
gangs_create_credits "1500"

// Decides how much credits will it cost to expend a gang
// -
// Default: "750"
gangs_expend_credits_per_slot "750"

// Define your Master Key here
// -
// Default: ""
gangs_masterkey ""

// If enabled everyone with Master Key will be able to control every Gang!
// -
// Default: "1"
gangs_masterkey_use "1"

// Maximum members that can be at a Gang (AFTER EXPENTION)
// -
// Default: "10"
gangs_max_members "10"

// Decides if anyone can disband a Gang with a password, or just the Leader
// -
// Default: "1"
gangs_use_disband_pass "1"

// Decides if Gangs will be using Ranks for permissions or everyone can do anything
// -
// Default: "1"
gangs_use_ranks "1"

Commands:
!creategang - Creates a new Gang for 1500 credits(by default, editable). After typing creategang you should type your disband password in chat.

!disbandgang - Used only when gangs_use_disband_pass is set to 0. Gives you the ability to disband a Gang as a Leader.

!gang - Opens your Gang Main Menu, with info about your gang and features.

!gangs - Opens a menu that shows all the Gangs on the server, if public, you can join a Gang from that menu.

!gangmaster - Access the Gang Admin Menu with the Master Key you defined in the cfg.

Known Bugs:
None.

Changelog:
Code:

1.0.0 - Initial Release
1.0.1 - Added Translations, cleaned up code and make it a bit easier to read. TQuerys will come at the next version.


Feel free to post suggestions and requests of new features.

If you appreciate my work, feel free to Donate

Gecko 07-01-2013 19:18

Re: Gangs Mod - Jailbreak
 
You messed up your SQL syntax,
Code:

CREATE TABLE IF NOT EXISTS Gang.Gangs_Users
(
        SteamID varchar(255) NOT NULL,
        Name varchar(255) NOT NULL,
        Gang varchar(255) NOT NULL DEFAULT 'none',
        Rank varchar(255) NOT NULL DEFAULT 'none'
);

Should be

Code:

CREATE TABLE IF NOT EXISTS Gangs_Users
(
        SteamID varchar(255) NOT NULL,
        Name varchar(255) NOT NULL,
        Gang varchar(255) NOT NULL DEFAULT 'none',
        Rank varchar(255) NOT NULL DEFAULT 'none'
);

Without the "Gang.", otherwise it returns with denied permission.

As with the other CREATE statements.

Gecko 07-01-2013 20:13

Re: Gangs Mod - Jailbreak
 
Also this plugin lags my server quite a bit..

necavi 07-01-2013 20:18

Re: Gangs Mod - Jailbreak
 
Most of the lag could likely be attributed to the fact that this plugin seems to use non-threaded queries (a big no-no for what it is trying to do). Not to mention some very...poor coding overall.

Eden.Campo 07-02-2013 00:40

Re: Gangs Mod - Jailbreak
 
Quote:

Originally Posted by Gecko (Post 1981540)
You messed up your SQL syntax,
Code:

CREATE TABLE IF NOT EXISTS Gang.Gangs_Users
(
        SteamID varchar(255) NOT NULL,
        Name varchar(255) NOT NULL,
        Gang varchar(255) NOT NULL DEFAULT 'none',
        Rank varchar(255) NOT NULL DEFAULT 'none'
);

Should be

Code:

CREATE TABLE IF NOT EXISTS Gangs_Users
(
        SteamID varchar(255) NOT NULL,
        Name varchar(255) NOT NULL,
        Gang varchar(255) NOT NULL DEFAULT 'none',
        Rank varchar(255) NOT NULL DEFAULT 'none'
);

Without the "Gang.", otherwise it returns with denied permission.

As with the other CREATE statements.

@Gecko
Thanks, fixed that.

also, I will try using TQuerys to fix the lag issue, I'll upload a new version when I'm done.

nomy 07-02-2013 02:10

Re: Gangs Mod - Jailbreak
 
This is great, will give it a try!

Aim4Fame 07-02-2013 04:23

Re: Gangs Mod - Jailbreak
 
Make thisone with multilanguage pls!
Nice Plugin, thanks for public..

Eden.Campo 07-02-2013 14:00

Re: Gangs Mod - Jailbreak
 
Quote:

Originally Posted by Aim4Fame (Post 1981685)
Make thisone with multilanguage pls!
Nice Plugin, thanks for public..

@Aim4Fame
Thanks, I'm working on translations right now. Expect it ready tommarow+-.

@nomy
Thanks!

Also, working on TQuerys to reduce server lag, should fully be supported this week.

Thanks for all the comments.

Annihilator 07-02-2013 18:55

Re: [CS:S] Gangs Mod - Jailbreak
 
Nice plugin, looked though your code and here's a few suggestions:

When creating GangMainMenu you don't need to put the whole menu in an if statement, only the parts that are different for every rank.

Most of the huge if-else statements in onPlayerSpawn can be changed to switches.

Try not to create huge functions, divide them into smaller ones, so that you can reuse some of the smaller ones and the code should become shorter (and easier for others to read :D )

All in all, after TQueries, I will put this one to field testing :3

Eden.Campo 07-03-2013 01:54

Re: [CS:S] Gangs Mod - Jailbreak
 
Quote:

Originally Posted by Annihilator (Post 1982219)
Nice plugin, looked though your code and here's a few suggestions:

When creating GangMainMenu you don't need to put the whole menu in an if statement, only the parts that are different for every rank.

Most of the huge if-else statements in onPlayerSpawn can be changed to switches.

Try not to create huge functions, divide them into smaller ones, so that you can reuse some of the smaller ones and the code should become shorter (and easier for others to read :D )

All in all, after TQueries, I will put this one to field testing :3

@Annihilator
Thank you for the feedback.

I will release the new version today with your suggestions (:


All times are GMT -4. The time now is 19:16.

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