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

[CS:S/CS:GO] Knifetop (1.1 1/September/2015)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Plugin ID:
4799
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    7 
    Plugin Description:
    Do you like stabbing? Compete with other players!
    Old 08-31-2015 , 04:47   [CS:S/CS:GO] Knifetop (1.1 1/September/2015)
    Reply With Quote #1

    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);
    Attached Files
    File Type: inc knifetop.inc (2.0 KB, 741 views)
    File Type: smx knifetop.smx (10.3 KB, 791 views)
    File Type: sp Get Plugin or Get Source (knifetop.sp - 793 views - 10.1 KB)
    __________________
    retired

    Last edited by shavit; 05-22-2016 at 00:55. Reason: removed donation button
    shavit is offline
     



    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 13:33.


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