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

War Tracker + Enforcer


Post New Thread Reply   
 
Thread Tools Display Modes
Author
msleeper
Veteran Member
Join Date: May 2008
Location: Atlanta, Jawjuh
Plugin ID:
1324
Plugin Version:
1.2
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Tracks Soldier/Demo deaths for the War, and enforces classes
    Unapprover:
    Reason for Unapproving:
    Please disapprove since the War ended and the plugin is no longer needed/useful. Thanks. --msleeper
    Old 12-11-2009 , 19:46   War Tracker + Enforcer
    Reply With Quote #1

    War Tracker + Enforcer

    This plugin tracks Soldier vs. Demoman deaths for the War. This information is tracked very basically into the "default" MySQL database. Whenever a Soldier kills a Demoman or vice versa, it adds 1 to the death count.

    The plugin also is capable of enforcing player classes. Classes can be enforced to Soldier and Demo mixed, or Red Demo/Blu Soldier only. Note: I highly recommend non-team switching maps if you use the latter, since people will complain GREATLY when they are forced to swap teams to the class they dislike/do not support!

    I am not providing any web interface at this time for the stats, though I may in the future. You can check your War Stats in real-time by typing:

    Code:
    !warstats in chat
    /warstats in chat
    sm_warstats in console
    Anyone who wants to develop this further, please do. It should be very easy to get the kill stats using a PHP script for your website!

    Installation
    Installation is incredibly easy, install the plugin in your /addons/sourcemod/plugins/ directory and refresh your plugin list, or change map.

    Configuration
    A config file will automatically be generated in /cfg/sourcemod/ when the plugin is first ran.

    sm_wartrack_trackdeaths - Enable/disable kill tracking
    sm_wartrack_enforcemode - Class enforcement option. 0 = disabled, 1 = Demos and Soldiers only, 2 = Red Demos and Blu Soldiers.
    sm_wartrack_roundannounce = Enable/disable round start announcement.

    Use this SQL to create your table.

    PHP Code:
    CREATE TABLE IF NOT EXISTS `sm_wartrack` (
      `
    namevarchar(255NOT NULL,
      `
    valueint(11NOT NULL,
      
    PRIMARY KEY  (`name`)
    ENGINE=MyISAM DEFAULT CHARSET=latin1;
     
    INSERT INTO `sm_wartrack` (`name`, `value`) VALUES
    ('soldier_deaths'0),
    (
    'demoman_deaths'0); 
    Attached Files
    File Type: sp Get Plugin or Get Source (wartrack.sp - 640 views - 8.3 KB)
    __________________

    Last edited by msleeper; 12-12-2009 at 18:48.
    msleeper is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 12-11-2009 , 19:54   Re: War Tracker + Enforcer
    Reply With Quote #2

    Recommended maplist for enforcemode 2:

    PHP Code:
    cp_badlands
    cp_fastlane
    cp_granary
    cp_well
    cp_yukon_final
    cp_castle4
    ctf_2fort
    ctf_sawmill
    ctf_turbine
    ctf_well
    koth_garbage_day
    koth_harvest_event
    koth_lighthouse_rc5
    koth_nucleus
    koth_oilfield
    koth_sawmill
    koth_viaduct
    koth_waste
    tc_hydro 
    Note: cp_castle4 does change teams so you should make a map config for enforcemode 1.
    __________________
    msleeper is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 12-11-2009 , 21:33   Re: War Tracker + Enforcer
    Reply With Quote #3

    Updated to 1.1, added sm_warstats command to show chat output of tracked kills.
    __________________
    msleeper is offline
    LordVader!
    Member
    Join Date: Nov 2009
    Old 12-11-2009 , 22:29   Re: War Tracker + Enforcer
    Reply With Quote #4

    Great job!


    One request can you add the ability for the plugin to display the current war stats every x minutes? Maybe in the hint area of the screen?

    I'm going to install this on all of my servers and it would be nice to have the stats displayed periodically without the need to use a command.
    LordVader! is offline
    MjrNuT
    SourceMod Donor
    Join Date: Feb 2008
    Location: Under the Beaming CA Sun
    Old 12-11-2009 , 23:52   Re: War Tracker + Enforcer
    Reply With Quote #5

    Quote:
    Originally Posted by msleeper View Post

    I am not providing any web interface at this time for the stats, though I may in the future. You can check your War Stats in real-time by typing:
    Thanks for the plugin.

    I don't know how much work it would be for this, but maybe something to easily incorporate to already existing stats plugins w/ web tracking already, like TF2 Stats that was updated by DarthNinja?

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

    I'm not meaning you provide for all stats loggers existing, but if there was a general script one could take to implement, if that makes any sense as I'm just quite alien to code.


    Now for what I guess is fundamental question here as I'm just not seeing it.

    I see you've provided the script for creating the table.

    Thus, how does the plugin know to put the data in such a table? databases.cfg entry?

    Sorry for the n00b-ish.
    __________________
    Flames and Ash Gaming
    Addon: SM v1.4.0-dev MM 1.8.5-dev
    Plugins: Advertisements, Webshortcuts, spray tracer, SBans, RTD, gScramble Balance, misc
    MjrNuT is offline
    Nightbox
    Senior Member
    Join Date: Apr 2008
    Old 12-12-2009 , 05:15   Re: War Tracker + Enforcer
    Reply With Quote #6

    Code:
    L 12/12/2009 - 12:00:37: [SM] Native "IsClientConnected" reported: Client index 0 is invalid
    L 12/12/2009 - 12:00:37: [SM] Displaying call stack trace for plugin "wartrack.smx":
    L 12/12/2009 - 12:00:37: [SM]   [0]  Line 180, /home/groups/alliedmodders/forums/files/3/7/5/2/1/55074.attach::cmd_WarStats()
    Any idea?
    __________________
    Nightbox is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 12-12-2009 , 15:26   Re: War Tracker + Enforcer
    Reply With Quote #7

    Quote:
    Originally Posted by MjrNuT View Post
    I don't know how much work it would be for this, but maybe something to easily incorporate to already existing stats plugins w/ web tracking already, like TF2 Stats that was updated by DarthNinja?

    [. . .]


    Thus, how does the plugin know to put the data in such a table? databases.cfg entry?
    You can request your favorite stat tracking to add some sort of web interface or web output for this. As I said it should be extremely simple for someone with even the most basic of PHP knowledge. I will post a quick and dirty example here soon.

    The plugin uses the "default" database in the databases.cfg. Presumably this is the same one you use for web admin, SourceBans, etc. If not, just go ahead and modify your "default" database with the right information. Conversely, you can change which database it uses by editing this line:

    PHP Code:
        db SQL_Connect("default"trueErrorsizeof(Error)); 
    At lines 154 and 184.

    Quote:
    Originally Posted by LordVader! View Post
    One request can you add the ability for the plugin to display the current war stats every x minutes? Maybe in the hint area of the screen?
    I will add in a global announcement on Round Start when I...

    Quote:
    Originally Posted by Nightbox View Post
    Code:
    L 12/12/2009 - 12:00:37: [SM] Native "IsClientConnected" reported: Client index 0 is invalid
    L 12/12/2009 - 12:00:37: [SM] Displaying call stack trace for plugin "wartrack.smx":
    L 12/12/2009 - 12:00:37: [SM]   [0]  Line 180, /home/groups/alliedmodders/forums/files/3/7/5/2/1/55074.attach::cmd_WarStats()
    Any idea?
    Fix this up. It's a harmless error but I'll go ahead and fix it.
    __________________

    Last edited by msleeper; 12-12-2009 at 15:33.
    msleeper is offline
    Broseph
    Junior Member
    Join Date: Aug 2009
    Old 12-12-2009 , 15:49   Re: War Tracker + Enforcer
    Reply With Quote #8

    Can you use this to display kills in a message?
    Broseph is offline
    Nightbox
    Senior Member
    Join Date: Apr 2008
    Old 12-12-2009 , 16:27   Re: War Tracker + Enforcer
    Reply With Quote #9

    "t's a harmless error"

    typing !warstats shows nothing
    __________________
    Nightbox is offline
    msleeper
    Veteran Member
    Join Date: May 2008
    Location: Atlanta, Jawjuh
    Old 12-12-2009 , 17:30   Re: War Tracker + Enforcer
    Reply With Quote #10

    Quote:
    Originally Posted by Broseph View Post
    Can you use this to display kills in a message?
    What do you mean?

    Quote:
    Originally Posted by Nightbox View Post
    "t's a harmless error"

    typing !warstats shows nothing
    Did you create the table using the SQL I posted? The table needs to exsit before this will work.
    __________________
    msleeper is offline
    Reply



    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 08:54.


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