AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [CS:GO] StatTrak Knives 1.2.0 (https://forums.alliedmods.net/showthread.php?t=263832)

Neuro Toxin 06-02-2015 20:32

[CS:GO] StatTrak Knives 1.2.0
 
8 Attachment(s)
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
:bacon!::bacon!::bacon!:

heavenrave 06-02-2015 20:45

Re: [CS:GO] Knives 1.0.0
 
nice plugin :)

Addicted. 06-02-2015 20:46

Re: [CS:GO] Knives 1.0.0
 
Wow so users don't have to unequip their own knives now?

Good job on the plugin!

Neuro Toxin 06-02-2015 20:58

Re: [CS:GO] Knives 1.0.0
 
Quote:

Originally Posted by oaaron99 (Post 2304129)
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

Darkness_ 06-02-2015 21:22

Re: [CS:GO] Knives 1.0.0
 
PHP Code:

for (int client 1client MaxClientsclient++) //line 75 || client <= MaxClients 

Nice job! :bacon!::bacon!:

Neuro Toxin 06-02-2015 21:38

Re: [CS:GO] Knives 1.0.0
 
Quote:

Originally Posted by Darkness_ (Post 2304141)
PHP Code:

for (int client 1client MaxClientsclient++) //line 75 || client <= MaxClients 

Nice job! :bacon!::bacon!:

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 06-02-2015 21:54

Re: [CS:GO] Knives 1.0.0
 
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 :)

asdfxD 06-03-2015 00:11

Re: [CS:GO] Knives 1.0.0
 
your knife drops when you select the default knife and you don't have a knife.

http://i.imgur.com/2TSj7FY.png

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

Neuro Toxin 06-03-2015 00:48

Re: [CS:GO] Knives 1.0.0
 
Quote:

Originally Posted by asdfxD (Post 2304182)
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?

asdfxD 06-03-2015 00:58

Re: [CS:GO] Knives 1.0.0
 
Quote:

Originally Posted by Neuro Toxin (Post 2304195)
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


All times are GMT -4. The time now is 12:59.

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