AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:GO]Create weapons with CreateEntityByName that are not deagles (https://forums.alliedmods.net/showthread.php?t=258015)

DorCoMaNdO 02-11-2015 20:48

[CS:GO]Create weapons with CreateEntityByName that are not deagles
 
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?

Neuro Toxin 02-12-2015 03:14

Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
 
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.

DorCoMaNdO 02-12-2015 12:06

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

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

Neuro Toxin 02-12-2015 18:18

Re: [CS:GO]Create weapons with CreateEntityByName that are not deagles
 
For my knowledge can u advise if setting the item definition fixed this or did u use give player item?

Mitchell 02-12-2015 18:48

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

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

DorCoMaNdO 02-12-2015 19:24

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

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

Neuro Toxin 02-12-2015 20:33

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

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

Search for the classname


All times are GMT -4. The time now is 15:45.

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