AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   m_hActiveWeapon (https://forums.alliedmods.net/showthread.php?t=315939)

Entity 05-02-2019 07:15

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

MasterMind420 05-02-2019 15:16

Re: m_hActiveWeapon
 
Quote:

Originally Posted by Entity (Post 2649778)
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

Entity 05-03-2019 11:24

Re: m_hActiveWeapon
 
Quote:

Originally Posted by MasterMind420 (Post 2649853)
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.

TheDS1337 05-03-2019 11:36

Re: m_hActiveWeapon
 
Quote:

Originally Posted by Entity (Post 2649997)
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);
}


Entity 05-04-2019 18:14

Re: m_hActiveWeapon
 
Quote:

Originally Posted by TheDS1337 (Post 2649999)
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...

Lux 05-04-2019 18:39

Re: m_hActiveWeapon
 
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.

andi67 05-05-2019 07:44

Re: m_hActiveWeapon
 
maybe you find something here to get what you want:https://forums.alliedmods.net/showpo...8&postcount=19

SZOKOZ 05-05-2019 13:10

Re: m_hActiveWeapon
 
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.

Entity 05-05-2019 16:12

Re: m_hActiveWeapon
 
Quote:

Originally Posted by SZOKOZ (Post 2650421)
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.

Neuro Toxin 05-05-2019 19:09

Re: m_hActiveWeapon
 
This may or may not help...

https://forums.alliedmods.net/showthread.php?p=877908


All times are GMT -4. The time now is 10:56.

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