Raised This Month: $32 Target: $400
 8% 

m_hActiveWeapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Entity
Member
Join Date: May 2016
Old 05-02-2019 , 07:15   m_hActiveWeapon
Reply With Quote #1

Hello, friends. There is a working way to get coordinate m_hActiveWeapon? GetEntPropVector -> return 0.0

Last edited by Entity; 05-02-2019 at 07:16.
Entity is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-02-2019 , 15:16   Re: m_hActiveWeapon
Reply With Quote #2

Quote:
Originally Posted by Entity View Post
Hello, friends. There is a working way to get coordinate m_hActiveWeapon? GetEntPropVector -> return 0.0
use GetEntPropEnt....its not a coordinate...it gets a players active weapon index
MasterMind420 is offline
Entity
Member
Join Date: May 2016
Old 05-03-2019 , 11:24   Re: m_hActiveWeapon
Reply With Quote #3

Quote:
Originally Posted by MasterMind420 View Post
use GetEntPropEnt....its not a coordinate...it gets a players active weapon index
I know that. I need to get the coordinates of the active weapon.
Entity is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 05-03-2019 , 11:36   Re: m_hActiveWeapon
Reply With Quote #4

Quote:
Originally Posted by Entity View Post
I know that. I need to get the coordinates of the active weapon.
You get the weapon entity id first, and then you get the coordinates using that entity id you just got.

Code:
int weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");

if( weapon != -1 )
{
        float origin[3];
        GetEntPropVector(weapon, Prop_Data, "m_vecOrigin", origin);
}

Last edited by TheDS1337; 05-03-2019 at 11:38.
TheDS1337 is offline
Entity
Member
Join Date: May 2016
Old 05-04-2019 , 18:14   Re: m_hActiveWeapon
Reply With Quote #5

Quote:
Originally Posted by TheDS1337 View Post
You get the weapon entity id first, and then you get the coordinates using that entity id you just got.

Code:
int weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");

if( weapon != -1 )
{
        float origin[3];
        GetEntPropVector(weapon, Prop_Data, "m_vecOrigin", origin);
}
This method will return Float:{0.0, 0.0, 0.0}. Otherwise I wouldn't have asked for help...

Last edited by Entity; 05-04-2019 at 18:15.
Entity is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 05-04-2019 , 18:39   Re: m_hActiveWeapon
Reply With Quote #6

No you can't get Active weapon like that, it uses some clientsided BoneMerging i think atleast in l4d something like that, you may have to call some function with SDKCall if some function like that exists.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 05-05-2019 , 07:44   Re: m_hActiveWeapon
Reply With Quote #7

maybe you find something here to get what you want:https://forums.alliedmods.net/showpo...8&postcount=19
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
SZOKOZ
Member
Join Date: Jan 2014
Old 05-05-2019 , 13:10   Re: m_hActiveWeapon
Reply With Quote #8

I'm guessing you want to attach something to the weapon and that's why you want the coordinate. Otherwise the player coordinate would be good enough. If you want to attach something to the weapon, attaching to the player bone the active weapon usually is will work well enough.
__________________
May still be available for SM scripting. Just look at my Steam profile regarding my availability.
My Steam
SZOKOZ is offline
Entity
Member
Join Date: May 2016
Old 05-05-2019 , 16:12   Re: m_hActiveWeapon
Reply With Quote #9

Quote:
Originally Posted by SZOKOZ View Post
I'm guessing you want to attach something to the weapon and that's why you want the coordinate. Otherwise the player coordinate would be good enough. If you want to attach something to the weapon, attaching to the player bone the active weapon usually is will work well enough.
You're right. I need to attach particle effect to the muzzle of the weapon.
Entity is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-05-2019 , 19:09   Re: m_hActiveWeapon
Reply With Quote #10

This may or may not help...

https://forums.alliedmods.net/showthread.php?p=877908
__________________
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 19:19.


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