Raised This Month: $ Target: $400
 0% 

CSGO CreateEntityByName giving funny results for snippers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-06-2015 , 00:51   CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #1

Hey fellow modders,

I require to create weapon entities using CreateEntityByName.

Everything is fine for non scooped weapons.

if I create a weapon_awp. When a player zooms and shoots. The zoom doesn't come out and back in.

Anyone know how to resolve this. I think I may be missing a net prop before dispatching spawn.

Please don't say I should use GivePlayerItem as it wont work for what I require.
__________________
Neuro Toxin is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-06-2015 , 06:23   Re: CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #2

try set definition index - https://github.com/Andersso/SM-Weapo...weapons---csgo

PHP Code:
SetEntProp(weaponProp_Send"m_iItemDefinitionIndex"INDEX
EDIT: heh :-D https://forums.alliedmods.net/showthread.php?p=2261682 sry man, didn't know...

Last edited by KissLick; 03-06-2015 at 06:24.
KissLick is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-06-2015 , 07:40   Re: CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #3

Quote:
Originally Posted by KissLick View Post
try set definition index - https://github.com/Andersso/SM-Weapo...weapons---csgo

PHP Code:
SetEntProp(weaponProp_Send"m_iItemDefinitionIndex"INDEX
EDIT: heh :-D https://forums.alliedmods.net/showthread.php?p=2261682 sry man, didn't know...
lol I know I just recalled he made that post but...

Yeah Neuro it's what you posted above you'd have to do it for all guns.
Indexs as you said are in game_items.txt
Brrdy is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-06-2015 , 08:04   Re: CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #4

Edit: I forgot to mention in the first post I am setting the definition index
______________________

The definition index doesn't help make a snipers zoom work properly.

What I ended up doing was using SDKCall for GiveNamedItem.

GiveNamedItem allows editing of netprops before calling DispatchSpawn like CreateEntityByName while it does the work of GivePlayerItem by loading the weapon script.

Only downside is it depends on accurate game data which will break from time to time.
__________________

Last edited by Neuro Toxin; 03-06-2015 at 08:08.
Neuro Toxin is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-06-2015 , 10:14   Re: CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #5

Quote:
Originally Posted by Neuro Toxin View Post
Edit: I forgot to mention in the first post I am setting the definition index
______________________

The definition index doesn't help make a snipers zoom work properly.

What I ended up doing was using SDKCall for GiveNamedItem.

GiveNamedItem allows editing of netprops before calling DispatchSpawn like CreateEntityByName while it does the work of GivePlayerItem by loading the weapon script.

Only downside is it depends on accurate game data which will break from time to time.
Oh yeah I know for sure that it breaks scope on AUG too. Even with right model index I think it's just a bug that needs to be fixed with SM or idk tbh I couldn't fix it on my UB3R guns plugins where I have to use modelindex and stuff ;P
Brrdy is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-06-2015 , 15:33   Re: CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #6

Sorry, i should tell you that the reason this happens is because the weapon's net class is still a deagle.
Use bool:GetEntityNetClass to verify what im saying is true.
Mitchell is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 03-06-2015 , 18:05   Re: CSGO CreateEntityByName giving funny results for snippers
Reply With Quote #7

Quote:
Originally Posted by Mitchell View Post
Sorry, i should tell you that the reason this happens is because the weapon's net class is still a deagle.
Use bool:GetEntityNetClass to verify what im saying is true.
I will confirm later today

Either way GiveNamedItem works as expected and doesn't call DispatchSpawn on you.
__________________
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 15:17.


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