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

[CS:GO]Create weapons with CreateEntityByName that are not deagles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DorCoMaNdO
Senior Member
Join Date: Feb 2012
Old 02-11-2015 , 20:48   [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #1

For quite some time I know about some plugins having an issue where some weapons given by them sound and hit like a deagle, with no recoil.
I've been trying to fix one of my plugins from CS:S to CS:GO and encountered the issue myself, where any weapon created with CreateEntityByName will be a deagle "skinned" as the desired weapon.
I was looking around but had no luck in finding a fix (and yes, using CreateEntityByName is necessary for my code).
Does anyone know how to fix the issue?
DorCoMaNdO is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-12-2015 , 03:14   Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #2

This is due to the net send property for the item definition index being set to 1 which is the deagle.

I believe setting m_iItemDefinition to the correct index before dispatching spawn should resolve your issue.

I haven't gone down the path of fixing this before as I use GivePlayerItem to spawn weapon entities.
__________________
Neuro Toxin is offline
DorCoMaNdO
Senior Member
Join Date: Feb 2012
Old 02-12-2015 , 12:06   Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #3

Quote:
Originally Posted by Neuro Toxin View Post
This is due to the net send property for the item definition index being set to 1 which is the deagle.

I believe setting m_iItemDefinition to the correct index before dispatching spawn should resolve your issue.

I haven't gone down the path of fixing this before as I use GivePlayerItem to spawn weapon entities.
THANK YOU!
DorCoMaNdO is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-12-2015 , 18:18   Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #4

For my knowledge can u advise if setting the item definition fixed this or did u use give player item?
__________________
Neuro Toxin is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-12-2015 , 18:48   Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #5

Quote:
Originally Posted by Neuro Toxin View Post
For my knowledge can u advise if setting the item definition fixed this or did u use give player item?
i havent test this, but i've messed around with it before.
it should fix the issue, how ever im curious about the ammo of the weapon. (mainly the clip)
also what about the other netprops weapons use that the client gives the weapon.
Mitchell is offline
DorCoMaNdO
Senior Member
Join Date: Feb 2012
Old 02-12-2015 , 19:24   Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
For my knowledge can u advise if setting the item definition fixed this or did u use give player item?
I set the item definition.
Code:
SetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex", 1);
1 is as you said, a Deagle, I've made a debug code for created entities and spawned some weapons using giveplayeritem to get the definition index of each weapon.
DorCoMaNdO is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 02-12-2015 , 20:33   Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
Reply With Quote #7

Thanks

Btw u can find the index values in csgo/scripts/items/items_game.txt

Search for the classname
__________________
Neuro Toxin is offline
Reply



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 14:57.


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