Raised This Month: $344 Target: $400
 86%   Almost there!

[CS:GO] StatTrak Knives 1.2.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Plugin ID:
4661
Plugin Version:
1.2.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Yet another knives plugin
    Unapprover:
    Reason for Unapproving:
    https://www.mail-archive.com/[email protected]/msg11235.html
    Old 06-02-2015 , 20:32   [CS:GO] StatTrak Knives 1.2.0
    Reply With Quote #1

    WARNING: THIS PLUGIN WILL GET YOUR SERVER GSLT BANNED.

    You may be thinking, why another knives plugin for CS:GO?

    The answer, this plugin uses DHooks to hook GiveNamedItem to process knife selections. The result is a 100% stable knives plugin with a very simple implementation. This is built to determine if this implementation will stop servers crashing with plugins that are well know to crash with Klexen's knife upgrade plugin.

    This plugin doesn't respawn your knife, It hooks your knife being spawned and sets the definition index to your selection. This means a few things:

    Features:

    * Servers "shouldn't" crash at all!
    * If you have a knife selected in your loadout, this plugin will replace that knife!
    * All knives come with StatTrak counters which actually work!
    * Preference storage to MySQL!

    Installation:

    1. Install Latest DHooks!
    2. Add "knives" entry into database.cfg (note: you can use cvar knives_database_name to use another entry)
    3. Copy the contents of the attached zip into your "/csgo/addons/sourcemod/" directory
    4. Restart your server
    5. Type !knife in game to open the knife selection menu

    Convars:
    Code:
    knives_database_name "knives"
    knives_safemode 0
    knives_restore_itemid 0

    Know Issues:

    This plugin relies on game data to function properly. When Valve push large updates the game data may require updating. I will always update it as quickly as possible and post it in this thread. Otherwise, for those of you smart enough, you can find the offsets here. The virtual offset name is 'CCSPlayer::GiveNamedItem'.

    Notes:

    Currently this is a very basic plugin. If this works well (doesn't cause crashes) I plan to implement a few more features.

    * Auto data loading from CSGO game data (no configs).
    * Forwards for paintkit plugins to force fallback data
    * More !commands like !flip and !butterfly

    Feedback:

    Reply in this thread with your plugin list if you experience any crashes. If you get crashes with Klexen's knife upgrade plugin and not this plugin, also post to let me know.

    Updates:

    Version 1.2.0
    * Added Display Type feature that allows players to control how their weapon items spawn
    * Added safeguard to pre hook (should stop any server crashes)
    * Added debug messages to help a bug that stops players having their knife spawned
    Version 1.1.4
    * Fixed lots of client crashes (hopefully)
    * Your loadout paintkit for your knife now leaks to !knife selection (again)
    Version 1.1.3
    * Fixed weapon index error related to knives_restore_itemid
    * Fixed memory lead related to knives_restore_itemid
    Version 1.1.2
    * Fixed lots of client crashes (hopefully)
    * Added cvar knives_restore_itemid (default 0) for testing
    Version 1.1.1
    * Fixed steamid's not storing properly in MySQL database
    * Added convar knives_safemode (default 0) for testing
    Version 1.1.0
    * Added MySQL support for preference saving
    * Added StatTrak counters
    Version 1.0.2
    * Fixed bug in GiveNamedItem prehook
    Version 1.0.1
    * Disabled players inventory paintkit from applying to their selected knife
    * Fixed animation glitches for the falchion and butterfly knives
    * Bots are not processed
    Attached Files
    File Type: zip knives-100.zip (13.2 KB, 308 views)
    File Type: zip knives-101.zip (15.4 KB, 214 views)
    File Type: zip knives-102.zip (15.5 KB, 195 views)
    File Type: zip knives-111.zip (23.7 KB, 177 views)
    File Type: zip knives-112.zip (249.8 KB, 240 views)
    File Type: zip knives-113.zip (249.8 KB, 185 views)
    File Type: zip knives-114.zip (24.5 KB, 207 views)
    File Type: zip knives-120.zip (27.5 KB, 1219 views)
    __________________

    Last edited by Neuro Toxin; 05-08-2017 at 00:31.
    Neuro Toxin is offline
    heavenrave
    SourceMod Donor
    Join Date: Jun 2014
    Old 06-02-2015 , 20:45   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #2

    nice plugin
    heavenrave is offline
    Addicted.
    AlliedModders Donor
    Join Date: Dec 2013
    Location: 0xA9D0DC
    Old 06-02-2015 , 20:46   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #3

    Wow so users don't have to unequip their own knives now?

    Good job on the plugin!
    Addicted. is offline
    Neuro Toxin
    Veteran Member
    Join Date: Oct 2013
    Location: { closing the void; }
    Old 06-02-2015 , 20:58   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #4

    Quote:
    Originally Posted by oaaron99 View Post
    Wow so users don't have to unequip their own knives now?

    Good job on the plugin!
    They don't

    However their paintkit carriers between the knife selections.

    An example:

    - I have a flip knife fade selected in my CSGO loadout.
    - I select a gut knife in this plugin

    I will receive a gut knife fade.

    I'm not sure what to think about that yet lol
    __________________
    Neuro Toxin is offline
    Darkness_
    Veteran Member
    Join Date: Nov 2014
    Old 06-02-2015 , 21:22   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #5

    PHP Code:
    for (int client 1client MaxClientsclient++) //line 75 || client <= MaxClients 
    Nice job!

    Last edited by Darkness_; 06-02-2015 at 21:25.
    Darkness_ is offline
    Neuro Toxin
    Veteran Member
    Join Date: Oct 2013
    Location: { closing the void; }
    Old 06-02-2015 , 21:38   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #6

    Quote:
    Originally Posted by Darkness_ View Post
    PHP Code:
    for (int client 1client MaxClientsclient++) //line 75 || client <= MaxClients 
    Nice job!
    Code:
    for (int client = 1; client < MaxClients; client++)
    This works fine for me when testing. Late loading is hooking all players aok.

    I'll do some more testing to ensure any clients at the MaxClients index don't get missed
    __________________
    Neuro Toxin is offline
    Neuro Toxin
    Veteran Member
    Join Date: Oct 2013
    Location: { closing the void; }
    Old 06-02-2015 , 21:54   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #7

    Code:
    public void OnConfigsExecuted()
    {
        int hookedcount = 0;
    
        // Late loading here is the best place
        for (int client = 1; client < MaxClients; client++)
        {
            if (!IsClientConnected(client))
                continue;
                
            OnClientConnected(client);
            
            if (!IsClientInGame(client))
                continue;
                
            OnClientPutInServer(client);
            hookedcount++;
        }
        
        PrintToChatAll("\x01[SM] \x04%d clients have been hooked!", hookedcount); 
    }
    PrintToChatAll always shows the correct number of clients being hooked on late load
    __________________
    Neuro Toxin is offline
    asdfxD
    Veteran Member
    Join Date: Apr 2011
    Old 06-03-2015 , 00:11   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #8

    your knife drops when you select the default knife and you don't have a knife.



    butterfly is funny, you see the bug here: https://www.youtube.com/watch?v=lW5a...ature=youtu.be

    Last edited by asdfxD; 06-03-2015 at 00:22.
    asdfxD is offline
    Neuro Toxin
    Veteran Member
    Join Date: Oct 2013
    Location: { closing the void; }
    Old 06-03-2015 , 00:48   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #9

    Quote:
    Originally Posted by asdfxD View Post
    your knife drops when you select the default knife and you don't have a knife.
    Do you buy chance hold a taser when this happens?
    __________________
    Neuro Toxin is offline
    asdfxD
    Veteran Member
    Join Date: Apr 2011
    Old 06-03-2015 , 00:58   Re: [CS:GO] Knives 1.0.0
    Reply With Quote #10

    Quote:
    Originally Posted by Neuro Toxin View Post
    Do you buy chance hold a taser when this happens?
    no. the falchion knife in hand does a random knife attack always. (mouse1)

    have only sourcemod + metamod and only your plugin installed @linux

    Last edited by asdfxD; 06-03-2015 at 01:03.
    asdfxD is offline
    Reply


    Thread Tools
    Display Modes

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


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