View Single Post
muukis
Veteran Member
Join Date: Apr 2009
Old 09-14-2009 , 07:34   [L4D] Perkmod 1.4db and 2.2.2db
Reply With Quote #200

I made small modifications for the Perkmod so that it now saves the player selected custom values to a database. Next time the same player drops by the previously selected Perks will be set as default.

New ConVars
l4d_perkmod_db_enabled (default="0")
If set to 1, player custom perk choices will be stored to database and used as default values next time.
l4d_perkmod_db_conf_name (default="default")
The DB connection configuration read from databases.cfg.

Installation
Modify databases.cfg to have a configuration for the Perkmod and then update the plugin. For the modified databases.cfg to come into operation, the game server may require a restart? Add new convars with correct values to perkmod2.cfg or alternatively delete the perkmod2.cfg file and load the plugin to create new config file. Attention! Perkmod.smx and the original Perkmod2.smx uses perkmod.cfg for configurations while the modified Perkmod2.smx uses perkmod2.cfg.
Code:
    "perkmod"
    {
        "driver"              "mysql"
        "host"                "YOUR_DB_SERVER_ADDRESS"
        "database"            "YOUR_DB_NAME"
        "user"                "YOUR_DB_USERNAME"
        "pass"                "YOUR_DB_PASSWORD"
    }
EDIT1: It seems to work as specified. I should probably include a way to disable the database functionality. As it is, it should work without the database like the original does, but it will write some error log every time the plugin loads up. That's every time the map changes?
EDIT2: Added ConVars.
EDIT3: Hupsistakeikkaa (translation to English: oops.) After the ConVar update the DB did not always connect. Now it should work as specified.
EDIT4: Uploaded a modified version from 2.0.10. This version compiles but is still completely untested.
EDIT5: Uploaded a modified version from 2.0.11. This version is tested to at least store data. It should be fully working.
EDIT6: Couple of edits and bugfixes to the database code. Tested to work.
EDIT7: Should now work for the team infected also.
EDIT8: Uploaded a modified version from 2.1.0.
EDIT9: Uploaded a modified version from 2.1.1.
EDIT10: Uploaded a modified version from 2.1.2.
EDIT11: Uploaded a modified version from 2.1.3.
EDIT12: Uploaded a modified version from 2.1.4.
EDIT13: Uploaded a modified version from 2.1.5.
EDIT14: Uploaded a modified version from 2.2.2.
Attached Files
File Type: sp Get Plugin or Get Source (Perkmod.sp - 3210 views - 261.8 KB)
File Type: sp Get Plugin or Get Source (perkmod2.sp - 2855 views - 375.8 KB)

Last edited by muukis; 11-12-2013 at 09:44. Reason: Perkmod2 upload
muukis is offline