Home » [L4D & L4D2] Custom Player Stats v1.4B121

[L4D & L4D2] Custom Player Stats v1.4B121

Custom Player Stats development is now public in GitHub.

Search for servers running Custom Player Stats: Click here

Features

Supported gamemodes:

  1. L4D: ALL
  2. L4D2: ALL

Applies to all game modes:

  • Medkit (and [L4D2] Defibrillator) usage forces team score reduction for the rest of the map.
  • Friendly fire cooldown modes: general and player specific.
  • Melee kills are counted but (currently) not awarded.
  • Point losses are given from bot related actions (friendly fire a bot controlled team mate.)
  • Friendly fire damage based point loss. Formula: sm_l4dstats_ffire_multiplier * Damage. Keep in mind that there is also a multiplier for Advanced (2) and Expert (4) difficulty that is added to the score. If you play Co-op on Expert, and hit a friendly with damage of 10, you would normally be fined 4 * 25 = 100 points. If this feature is enabled and the multiplier was 2.0, you would be fined 4 * 2 * 10 = 80. If you would hit friendlies with damage of 20, you would be fined 160 points.
  • Crown a Witch and [L4D2] Level a Charge (kill a charging Charger with a melee weapon) awards.
  • New client commands: (usage same as “rank” and “top10“)
    • nextrank – Show how many points is needed for gaining a rank.
    • top10ppm – Show Top10 Points Per Minute players.
    • showrank – Show player ranks from currently playing players.
    • showppm – Show player Points Per Minute from currently playing players.
    • showtimer – Show timer (Timed Maps).
    • rankvote – Initiate vote for shuffling teams based on their Points Per Minute ratio. More details below.
    • timedmaps – Show all map times (Timed Maps).
    • maptimes – Show current map times (Timed Maps).
    • rankmenu – Show rank menu.
    • rankmutetoggle – Toggle mute/unmute Custom Player Stats.
    • showmotd – Show the message of the day.

Applies to Versus and [L4D2] Scavenge modes:

  • General infected score:
    • Direct damage done by a special infected.
    • External damage (damage done by normal zombies while under the influence of a special zombie – boomer blindness / smoker choke / hunter lunge / [L4D2] jockey ride / [L4D2] charger plummel and carry – is forwarded to the special infected.)
    • Direct Incapacitate and Kill a survivor.
    • External Incapacitate and Kill a survivor.
    • Award from causing a survivor to grab a ledge.
    • Infected team penalty from letting survivors reach a saferoom and loosing a campaign finale.
  • Boomer blindness and award from a Perfect Blindness (default 4 survivors.)
  • Hunter award from Pain From Above (default damage >= 15) and Death From Above (default damage >= 25) pounces.
  • Tank Sniper (hit a survivor with a rock) and Bulldozer (default damage >= 200.)
  • Charger Scattering Ram (default 4 survivors.)

Applies to L4D2:

  • Penalty to whole survivor team for a triggering car alarm.
  • Earn points by giving Adrenaline or reviving player with a defibrillator.
  • Earn points by successfully pouring a gas canister.
  • Earn points by deploying an ammo upgrade.

[L4D2] Realism Support Explained:

As far as I know, the Realism gamemode is nothing more but tougher Co-op gamemode. The support only adds a multiplier to the score a player would gather from the same action in Co-op. My randomly selected default value for Realism score multiplier is 1.5. You can change this value and find the best possible value with the CVAR that controls it (read below).

[L4D2] Team Versus Support Explained:

As far as I know (again), the Team Versus gamemode is same as Versus. For this reason, the support only means that any game played in Team Versus gamemode, will be stored as Versus gamemode. To be more accurate, it means all the points earned playing Team Versus or Versus are mixed and both are read as Versus.

Survival Support Explained:

Players earn the normal score from killing the infected. Server administrators can set a CVAR to enable/disable score earned from health related actions. The Survival maps are filled with medical resources and I thought it’s too easy to score points using the meds. I will put some more effort in to this gamemode soon…

[L4D2] Scavenge and Team Scavenge Support Explained:

In current state the plugin simply stores normal statistics. I will put some more effort in to this gamemode soon…

Timed Maps Explained:

All single team gamemodes record time of each map. This feature is currently not used in anything Rank related, only for statistical information. Unlike all other gamemodes, Survival will store the longest times instead of shortest times. I will put some more effort in to this feature and will add a panel for the players to view top times per map and their own times as well… soon…

Rank Vote Explained:

Rank Vote feature work only in two teams gamemodes: Versus and [L4D2] Scavenge. Note that L4D2 Team gamemodes are not supported! Each player can initiate a vote to shuffle teams by player PPM (Points Per Minute). A passing vote requires more that 50% of YES votes, so exactly half is not enough. When a Rank Vote passes, teams are set so that the highest ranking (PPM) player remains in the original team. Then the next player at PPM ranking is put to the opposite team, and the next to the highest ranking players team, and so on. This hopefully will lead to more equal teams. Read Quick installation guide for important information regarding Rank Vote!

LAN Support Explained:

When playing in LAN (sv_lan = 1) the stats are recorded with IP as player identity. Warning! This feature is highly unreliable because IP addresses are not necessarily static and individual. The webstats don’t fully support the IP based stats and some links may not work as specified.

Message Of The Day Explained:

A server administrator can leave a Message Of The Day using console command sm_rank_motd. This MOTD is then shown at the web stats page. I have planned to send this value to everyone joining the game server. As of today, it is not yet done.
Tip: Edit your game server file motd.txt to have your web stats motd.php page.

Webstats Templates Explained:

Webstats can contain multiple templates. An easy example: Add a directory in templates and copy statstooltip.js from default to the new directory. Then edit the copied statstooltip.js color settings. Finally when all modifications are done, edit you config.php template and set the variable $site_template to contain the added directory name. I have included a demo template in the package, so you get the idea. If you can come up with something neat, send me a copy and I’ll add it to the package!

Sound Effects Explained:

Plugin will play sound effects on certain events. All of the sound are included in the game installation. You can mute the plugin by modifying CVAR #55. Here is a list of events and what sound are played when the event occurs: (Sounds may vary on L4D1 and L4D2)

  • Map timer start (Timed Maps) – Short ticking sound.
  • Improve previous personal map time (Timed Maps) – Bell sound.
  • Rankvote gets passed and teams are shuffled – “Teleportation” sound.
  • Rankmenu opens.
  • I.e. successful Boomer Perfect Blindness or Hunter Death From Above.

Web Stats Player Country Flags and Location Explained:

If you want to see what country and city are your players from, you can do so by modifying your config.php. Read the installation instructions from the config.php file. Player country and city is identified by their IP. If you have trouble getting the country database inserted, try executing the scripts from console (windows command prompt or unix/linux shell): ./php install.php

Admin panel “Player Stats” category

Game server administrators flagged with ADMFLAG_ROOT can use the Administrators panel (sm_admin) to clean or clear player stats. Using this feature will physically remove data from the database, so be careful. There are multiple options to choose from. Here are the descriptions for the options:

  1. Clear…
    1. Clear stats from currently playing player… – Clear selected player stats. Selected from a list of players currently online at the same server.
    2. Clear timed maps… – Clear map timings by gamemode. (confirmation required)
  2. Clear Players – Delete all players from the database. (confirmation required)
  3. Clear Maps – Set zero to all fields in maps table. This operation will not delete the rows in the database. (confirmation required)
  4. Clear All – Does steps 2, 3 and 7. (confirmation required)
  5. Remove Custom Maps – Deletes all maps where custom = 1. (confirmation required)
  6. Clean Players – Deletes old players. Result is configurable with CVARs 42 and 43. (confirmation required)
  7. Clear timed maps – Deletes all map timings. (confirmation required)

Console commands

  1. sm_rank_clear – Game server administrators flagged with ADMFLAG_ROOT can clear the database like it was just installed. (confirmation required)
  2. sm_rank_shuffle – Game server administrators flagged with ADMFLAG_KICK can shuffle teams by player PPM (Points Per Minute).
  3. sm_rankmenu – Show a menu of all available commands.
  4. sm_rankmute <0|1> – Mute or unmute Custom Player Stats.
  5. sm_rank_motd <message> – Update Message Of The Day.

New CVARs

  1. l4d_stats_ffire_cooldown (default = “10.0”) Time in seconds for friendly fire cooldown
  2. l4d_stats_ffire_cooldownmode (default = “1”) Friendly fire cooldown mode. 0 = Disable, 1 = Player specific, 2 = General
  3. l4d_stats_ledgegrap (default = “15”) Base score for causing a survivor to grap a ledge
  4. l4d_stats_infected_damage (default = “2”) The amount of damage inflicted to Survivors to earn 1 point
  5. l4d_stats_announceteam (default = “2”) Chat announcment team messages to the team only mode. 0 = Print messages to all teams, 1 = Print messages to own team only, 2 = Print messages to own team and spectators only
  6. l4d_stats_infected_win (default = “30”) Base victory score for Infected Team
  7. l4d_stats_medkitpenalty (default = “0.1”) Score reduction for all Survivor earned points for each used Medkit (NormalPoints * (1 – MedkitsUsed * MedkitPenalty))
  8. l4d_stats_medkitpenaltymax (default = “1.0”) Maximum score reduction (the score reduction will not go over this value when a Medkit is used)
  9. l4d_stats_medkitpenaltyfree (default = “0”) Team Survivors can use this many Medkits for free without any reduction to the score
  10. l4d_stats_survivor_death (default = “40”) Base score for killing a Survivor
  11. l4d_stats_survivor_incap (default = “15”) Base score for incapacitating a Survivor
  12. l4d_stats_perfectpouncedamage (default = “25”) The amount of damage from Perfect Pounce to earn success points
  13. l4d_stats_perfectpouncesuccess (default = “25”) Base score for a successful Perfect Pounce
  14. l4d_stats_nicepouncedamage (default = “15”) The amount of damage from Nice Pounce to earn success points
  15. l4d_stats_nicepouncesuccess (default = “10”) Base score for a successful Nice Pounce
  16. l4d_stats_hunterdamagecap (default = “25”) Hunter stored damage cap
  17. l4d_stats_boomersuccess (default = “5”) Base score for a successfully vomiting on survivor
  18. l4d_stats_boomerperfecthits (default = “4”) The number of survivors that needs to get blinded to earn Boomer Perfect Vomit Award and success points
  19. l4d_stats_boomerperfectsuccess (default = “30”) Base score for a successful pounce
  20. l4d_stats_tankdmgcap (default = “500”) Maximum inflicted damage done by Tank to earn Infected damagepoints
  21. l4d_stats_bulldozer (default = “200”) Damage inflicted by Tank to earn Bulldozer Award and success points
  22. l4d_stats_bulldozersuccess (default = “50”) Base score for Bulldozer Award
  23. l4d_stats_tankthrowrocksuccess (default = “5”) Base score for a Tank thrown rock hit
  24. l4d_stats_enablerealism (default = “1”) [L4D2] Enable/Disable realism stat tracking
  25. l4d_stats_realismmultiplier (default = “1.4”) [L4D2] Realism score multiplier for coop score
  26. l4d_stats_spitter (default = “5”) [L4D2] Base score for killing a Spitter
  27. l4d_stats_jockey (default = “5”) [L4D2] Base score for killing a Jockey
  28. l4d_stats_charger (default = “5”) [L4D2] Base score for killing a Charger
  29. l4d_stats_adrenaline (default = “15”) [L4D2] Base score for giving Adrenaline to a friendly
  30. l4d_stats_defib (default = “20”) [L4D2] Base score for using a Defibrillator on a friendly
  31. l4d_stats_jockeyride (default = “5”) [L4D2] Base score for saving a friendly from a Jockey Ride
  32. l4d_stats_chargerplummel (default = “5”) [L4D2] Base score for saving a friendly from a Charger Plummel
  33. l4d_stats_chargercarry (default = “5”) [L4D2] Base score for saving a friendly from a Charger Carry
  34. l4d_stats_caralarm (default = “50”) [L4D2] Base score for a Triggering Car Alarm
  35. l4d_stats_ffire_mode (default = “1”) Friendly fire mode. 0 = Normal, 1 = Cooldown, 2 = Damage based
  36. l4d_stats_ffire_multiplier (default = “1.5”) Friendly fire damage multiplier (Formula: Score = Damage * Multiplier)
  37. l4d_stats_announcerank (default = “1”) Chat announcment for rank change
  38. l4d_stats_announcerankinterval (default = “60”) Rank change check interval
  39. l4d_stats_matador (default = “30”) [L4D2] Base score for killing a charging Charger with a melee weapon
  40. l4d_stats_witchcrowned (default = “30”) Base score for crowning a witch
  41. l4d_stats_medkitbotmode (default = “1”) Add score reduction when bot uses a medkit. 0 = No, 1 = Bot uses a Medkit to a human player, 2 = Bot uses a Medkit to other than itself, 3 = Yes
  42. l4d_stats_adm_cleanoldplayers (default = “2”) How many months old players (last online time) will be cleaned. 0 = Disabled
  43. l4d_stats_adm_cleanplaytime (default = “30”) How many minutes of playtime to not get cleaned from stats. 0 = Disabled
  44. l4d_stats_enableteamversus (default = “1”) [L4D2] Enable/Disable team versus stat tracking
  45. l4d_stats_botscoremultiplier (default = “1.0”) Multiplier to use when receiving bot related score penalty. 0 = Disable
  46. l4d_stats_deployammoupgrade (default = “10”) [L4D2] Base score for deploying ammo upgrade pack
  47. l4d_stats_enablenegativescore (default = “1”) Enable point losses (negative score)
  48. l4d_stats_enablerankvote (default = “1”) Enable voting of team shuffle by player PPM (Points Per Minute)
  49. l4d_stats_enablescavenge (default = “1”) [L4D2] Enable/Disable scavenge stat tracking
  50. l4d_stats_enableteamscavenge (default = “1”) [L4D2] Enable/Disable team scavenge stat tracking
  51. l4d_stats_gascanpoured (default = “5”) [L4D2] Base score for successfully pouring a gascan
  52. l4d_stats_medicpointssv (default = “0”) Survival medic points enabled
  53. l4d_stats_rankvotetime (default = “20”) Time to wait people to vote
  54. l4d_stats_top10ppmplaytime (default = “30”) Minimum playtime (minutes) to show in top10 ppm list
  55. l4d_stats_soundsenabled (default = “1”) Play sounds on certain events
  56. l4d_stats_enablerealismvs (default = “1”) [L4D2] Enable/Disable realism versus stat tracking
  57. l4d_stats_realismvsmultiplier_s (default = “1.4”) [L4D2] Realism score multiplier for survivors versus score
  58. l4d_stats_realismvsmultiplier_i (default = “0.6”) [L4D2] Realism score multiplier for infected versus score
  59. l4d_stats_medkitpenaltyfree_r (default = “4”) [L4D2] Team Survivors can use this many Medkits for free without any reduction to the score when playing in Realism gamemodes (-1 = use the value in l4d_stats_medkitpenaltyfree)
  60. l4d_stats_chargerramsuccess (default = “40”) [L4D2] Base score for a successful Charger Scattering Ram
  61. l4d_stats_chargerramhits (default = “4”) [L4D2] The number of impacts on survivors to earn Scattering Ram Award and success points
  62. * l4d_stats_announceplayerjoined (default = “1”) Announce joining player rank and points
  63. * l4d_stats_announcemotd (default = “1”) Announce the message of the day for the joining players

CVARs marked with asterisk (*) are new and with exclamation mark (!) are modified from previous major release.

The web stats have changed a bit. There are multiple new variables in CONFIG.PHP:

$mysql_tableprefix = "";

// MySQL information for IP to Country DB
// Fill this if a separate database is used
$mysql_ip2c_server = “”;
$mysql_ip2c_db = “”;
$mysql_ip2c_user = “”;
$mysql_ip2c_password = “”;
$mysql_ip2c_tableprefix = “”;

// Supported game versions
// 0 = Support both L4D1 and L4D2
// 1 = Left 4 Dead 1 (default)
// 2 = Left 4 Dead 2
$game_version = 1;

// Template for the stats page.
// Leave empty if the default template is used.
// Usage: “mytemplate” (requires directory ./templates/mytemplate existence)
$site_template = “”;

$award_l4d2_file = “awards.l4d2.en.php”;

// Refresh interval (seconds) for the front page (index.php)
// 0 = disabled
$stats_refreshinterval = 0;

// Game server address (adds a Steam connection link over the site name)
// Multiple game server addresses supported (just write multiple configurations and use the correct syntax for each of them)
/* THIS LINE: DO NOT MODIFY OR REMOVE */ $game_addresses = array();
// Syntax:
// $game_addresses[] = array(“”, ”

[:]”);
// Examples:
// $game_addresses[] = array(“Server 1: Left 4 Dead 2”, “my.site.net:27016”);
// $game_addresses[] = array(“Server 2: Kill Them Zombies”, “123.0.0.234”);// Database time modifier (hours)
// 0 if the db time is the same as the websites
$dbtimemod = 0;

// Date format for player last online time
// http://www.php.net/manual/en/function.date.php
// Example: 24h – “M d, Y H:i”;
$lastonlineformat = “M d, Y g:ia”;

// Show player flags next to their names based on their IP
// 0 to disable
// Installation instructions:
// 1. Download and extract http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip to web stats root (same folder as install.php)
// 2. Execute install.php (use a web browser) – BE PATIENT AND WAIT FOR THE EXECUTION TO FINISH!
// 3. Delete files GeoIPCountryCSV.zip and GeoIPCountryWhois.csv when installation is successful
$showplayerflags = 0;

// Show player city name next to their flag and country name (player.php) based on their IP (has no effect when $showplayerflags = 0)
// 0 to disable
// Installation instructions:
// 1. Download latest GeoLiteCity_YYYYMMDD.zip from http://www.maxmind.com/app/geolitecity and extract the files to web stats root (same folder as install.php)
// 2. Execute install.php (use a web browser) – BE PATIENT AND WAIT FOR THE EXECUTION TO FINISH!
// 3. Delete files GeoLiteCity_YYYYMMDD.zip, GeoLiteCity-Blocks.csv and GeoLiteCity-Location.csv when installation is successful
$showplayercity = 0;

// Google Maps (player.php) additional URL parameters (URL postfix)
// Default: “&t=h&z=5”
// Examples: (there is more!)
// t => h = Satellite with labels / k = Satellite without labels / p = Terrain
// z => Zoom factor
// lci => com.panoramio.all = Photos / org.wikipedia.en = Wikipedia / com.youtube.all = Videos (combined with comma)
// Try out the usable parameters yourself
$googlemaps_addparam = “&t=h&z=5”;

// Google Maps (index.php) API key (get yours from http://code.google.com/apis/maps/signup.html)
$googlemaps_apikey = “”;

// Show Google Maps (index.php) location for the first # players online (useful when web stats hosts multiple game servers)
// 0 to show all players
$googlemaps_showplayersonlinecount = 0;

// Google Maps (index.php) players online additional URL parameters (URL postfix)
// Default: “&size=600×300&maptype=satellite&sensor=false”
$googlemaps_playersonline_addparam = “&size=600×300&maptype=satellite&sensor=false”;

// Google Maps (index.php) zoom when only one players online (or only server is displayed)
$googlemaps_playersonline_zoom = 3;

// Show/hide link for the timed maps (also disables the page for parameterless use)
$timedmaps_show_all = False;

// Allow reading of player Steam profile (overrides all avatar related if set to False)
// Warning! Setting value to true can slow loading of some pages.
$steam_profile_read = True;

// Show/hide player avatars (overrides all other avatar related if set to False)
$players_avatars_show = True;

// Show/hide online player avatars
// Warning! Setting value to true will slow down the index page some, depending how
// many players are currently online.
$players_online_avatars_show = False;

// Number of players to show additional info at Top 10 -players list (set to 0 to disable)
// Shows player avatar and some other information.
// Warning! Setting a number higher than 0 (zero) will slow every page load a little.
$top10players_additional_info = 0;

// Show Message Of The Day in each page
$show_motd = True;

You should set $game_version cariable correctly before running the install.php! They only affect on what maps will be inserted in the database and what values will be displayed in the web page. If you plan to mix the web stats with L4D and L4D2 servers, set the value to 0 (zero).

Also something noteworthy:
SPOKE TOO EARLY -> The strange “bug” that led to incorrect player names in the database should now be fixed. I have not seen any new bad player names in my DB. [FIX] Web stats contain “hidden” statistics which you can find for example by placing the mouse over player points. (ToolTip)
l4d_stats_web

Quick installation guide

You can install this over the original Player Stats.

  1. Prepare your MySQL database to accept connections from your web site and game server.
  2. Download web stats (l4d_stats_web.zip) and extract it to your website. PHP support required! Alternatively, if you dont want or need the web stats, or if you don’t have PHP or the skills to extract the queries from the install.php file, you can install the SQL dump (l4d2stats_sqldump.zip). You can skip to #7 if you decide to do the dump.
  3. Rename config_example.php to config.php and edit it.
  4. Execute install.php file.
  5. Delete install.php file.
  6. Add full read and write access to everyone for the website file /templates/awards_cache.html.
  7. [OPTIONAL] Download l4d_stats.txt to /addons/sourcemod/gamedataIf you don’t download this, your Rank Vote will be disabled.
  8. Edit your databases.cfg file at /addons/sourcemod/config. Insert “l4dstats” entry with a valid connection info to your Custom Player Stats database.
  9. Download compiled plugin (l4d_stats.smx) to /addons/sourcemod/plugins.

Tips

  • Bind a key to execute console command rankmenu. For example type bind f12 sm_rankmenu to your game console.

Files

  • File: l4d_stats_web • 7 MB • 91 Downloads
    Caption:
    Description:

Leave a Reply

Your email address will not be published. Required fields are marked *