View Single Post
Author Message
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
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, 430 views)
File Type: zip knives-101.zip (15.4 KB, 346 views)
File Type: zip knives-102.zip (15.5 KB, 309 views)
File Type: zip knives-111.zip (23.7 KB, 288 views)
File Type: zip knives-112.zip (249.8 KB, 378 views)
File Type: zip knives-113.zip (249.8 KB, 311 views)
File Type: zip knives-114.zip (24.5 KB, 330 views)
File Type: zip knives-120.zip (27.5 KB, 1359 views)
__________________

Last edited by Neuro Toxin; 05-08-2017 at 00:31.
Neuro Toxin is offline