Stabbing people offline for the lulz is illegal, go have fun online instead
Remake of the old uncontinued "KnifeTop" plugin, with CS:GO support, an API and features that seem useless to me removed. Written for the new SourcePawn syntax.
Changelog:
1.1 hotfix (1/September/2015) -
I'm retarded, fixed an issue where the killed person gets the amount of kills that his killer had.
Requirements:
A Counter-Strike: Source or Counter-Strike: Global Offensive server.
SourceMod 1.7 and above.
SM_Hosties 2's .inc files to compile.
A MySQL server,
may add SQLite support soon.
About:
It took me long enough to modify the old plugin in order to make it work with CS:GO. Well, not worth the time.
How about I make a new one which is also extensible? Good idea
SQL related code mostly taken from
shavit's simple bhop timer, give it a try if you own a server that needs a stable timer.
Features:
Counts knife kills.
Adds a top25 menu (sm_knifetop/sm_ktop).
Has a developer API.
Team filters.
SM_Hosties 2 support.
Installation:
1. Add a database entry in addons/sourcemod/configs/databases.cfg, call it "knifetop"
Example:
Code:
"Databases"
{
"driver_default" "mysql"
// When specifying "host", you may use an IP address, a hostname, or a socket file path
"default"
{
"driver" "default"
"host" "localhost"
"database" "sourcemod"
"user" "root"
"pass" ""
//"timeout" "0"
//"port" "0"
}
"knifetop"
{
"driver" "mysql"
"host" "localhost"
"database" "knifetop"
"user" "root"
"pass" ""
}
}
2. Copy the knifetop.smx file to your plugins (addons/sourcemod/plugins) folder.
3. Restart your server. (Manual loading isn't possible due to modifying databases.cfg)
3.1. (optional) Open cfg/sourcemod/plugin.knifetop.cfg, edit the configuration and restart the server again.
Commands:
Code:
] sm_rcon sm cmds knifetop
[SM] Listing commands for: Knifetop
[Name] [Type] [Help]
sm_knifetop console Opens a menu that shows the top25 stabbers!
sm_ktop console Opens a menu that shows the top25 stabbers!
Console Variables:
Code:
// This file was auto-generated by SourceMod (v1.7.2)
// ConVars for plugin "knifetop.smx"
// Is the plugin enabled?
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
knifetop_enable "1"
// In effect only if SM_Hosties 2 is installed on the server!
// Ignore knifetop_team if a knife kill was done between 2 players in a last request?
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
knifetop_hosties_lr "1"
// Which teams should have knife kills counted?
// 0 - Everyone
// 2 - Terroists
// 3 - Counter-Terrorists
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "3.000000"
knifetop_team "0"
// Amount of people to display when using sm_knifetop.
// -
// Default: "25"
// Minimum: "1.000000"
knifetop_top_limit "25"
Developers' API:
Code:
// Will never have a letter in it, you can use StringToFloat in other plugins in case you want backwards compability for new features I add
#define KNIFETOP_VERSION "1.0" // Will change over time
/**
* Called when a knife kill gets count to stats.
*
* @param client Client index.
* @param newkills Amount of knife kills after
* @noreturn
*/
forward void Knifetop_OnKnifeKill(int client, int newkills);
// excuse me for "Amount of knife kills after" but I had no proper way to express myself.
/**
* Gets the amount of knife kills from a player.
*
* @param client Client index.
* @return Amount of knife kills. 0 if never killed with a knife.
*/
native int Knifetop_GetKnifeKills(int client);