[CS:GO] GiveNamedItemEx 1.0.8
7 Attachment(s)
This plugin parses a forward to other plugins which allows them to edit weapon classnames and paintkits before they spawn.
This was made to resolve issues where knife and paintkit plugins cause crashes on certain server types. Note: This plugin on it's own doesn't do anything. It requires another plugin to actually edit the hook properties. It's made for Dummies and is really simple to use. Requires: The latest DHooks - Make sure you have the latest version Below is the example plugin: Code:
#include <givenameditem> Update 1.0.1 - Added Items API for classname vs item definition lookups - Added IsKnife lookups for classnames and item definitions - Updated example plugin Update 1.0.3 - Improved support for PAINTKIT_VANILLA - Added GiveNamedItemEx.TeamSwitch which switches a players team when the weapon is spawned - Added GiveNamedItemEx.GetWeaponTeamByItemDefinition (int) support - Added command sm_givenameditem_weaponprops. - Optimised plugin - Fixed a few small bugs - Updated example plugin Update 1.0.4 - Improved support for PAINTKIT_PLAYERS - Fixed bug in GiveNamedItemEx.GetWeaponTeamByItemDefinition Update 1.0.5 - Added GiveNamedItemEx.InUse Update 1.0.6 - Fixed GiveNamedItemEx.InUse - Improved method to force weapons to be active (thanks xCoderx) Update 1.0.8 - Fixed dependency and option requirements - Forced hook override to GiveNamedItem instead of GivePlayerItem - Improved support for Always Weapon Skins Special thanks xCoderx!, Drifter and all the feedback contributors in this thread. This was specially built for people like: Franc1sco, Klexen and Dr. API |
Re: [CS:GO] GiveNamedItem Hook
Plugins using this forward:
Always Weapon SkinsGood Practice: * Never call GivePlayerItem or GiveNamedItem inside this hook!Q&A Q: Do I have to set all the default settings like in your example plugin code? A: No, while it doesn't ultimately matter:- you should only set the properties for what you plan to change. Q: How do I get the item definition of the classname being spawned? A: Use GiveNamedItemEx.GetItemDefinitionByClassname( const char[] classname). This is an expensive lookup function, so try and avoid using it more than once. Q: Is there an easy way to know if a knife is being spawned? A: Use GiveNamedItemEx.IsItemDefinitionKnife(int itemdefinition). This is an expensive lookup function, so try and avoid using it more than once. Q: When I change the classname, the players receive their original paintkit with the new weapon. A: You need to set GiveNamedItemEx.Paintkit to PAINTKIT_VANILLA. Q: Why cant I return Plugin_Stop? A: There should never be a need to do this. Q: I'm not getting StatTrak items when I set GiveNamedItemEx.Kills? A: GiveNamedItemEx.Kills requires GiveNamedItemEx.Paintkit to be set. If you don't want to set a paintkit, try using PAINTKIT_VANILLA or PAINTKIT_PLAYERS. |
Re: [CS:GO] GiveNamedItem Hook
Well done!
Could you please tell me what the m_nFallbackSeed is? Is it maybe the position of the pattern? |
Re: [CS:GO] GiveNamedItem Hook
Quote:
An example is: 100 seed for a fade paintkit is 100% fade! |
Re: [CS:GO] GiveNamedItem Hook
So is the Seed a value from 0-100 or can it be 0-752 at another skin?
|
Re: [CS:GO] GiveNamedItem Hook
Good question. I'm not exactly sure.
I personally only allow values from 0-100 in my paintkits plugin. Edit: This hook doesn't validate the value you set, so you can try any value you like |
Re: [CS:GO] GiveNamedItem Hook
When it's really only from 0-100, that would mean that only 100 different patterns of a skin exist.
But I don't believe this, it would be to static for valve, I'm sure that there is some float value. One more thing is, does people who are fresh connected see the faked item or is it more luck to see someones fake skin after joining? With the old method it was for me like when the client didn't received the info that this item got edited he didn't saw the skin clientside then. Ex.: I had a huge lag clientside when I spawned, and I didn't received the info then and I had vanilla skin (It was serverside edited, and people even told me). Or sometimes, when I stay over 30 min afk it feels like the steam server went down and up again (the only logically thing for me) and so they told me to update the skin and I got my one selected in the inventory when I was alive and had the weapon selected.. |
Re: [CS:GO] GiveNamedItem Hook
None of your concerns happen with this hook.
It's all smooth. EIconView is not edited, it uses the fallback props which is what your after from what I understand in your last post. |
Re: [CS:GO] GiveNamedItem Hook
Oh fine I understand.
Thanks for sharing your hard coded work! |
Re: [CS:GO] GiveNamedItem Hook
Nice work! you always do :) I would like to use yout OnGiveNamedItemEx with my snippet: https://forums.alliedmods.net/showthread.php?t=264254 to see if I hav the same issues with machines guns and aug/sg556 but I'm too lazy :bacon!:
|
All times are GMT -4. The time now is 14:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.