AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Set equiped weapon glow (https://forums.alliedmods.net/showthread.php?t=308772)

esenrik 07-03-2018 09:16

Set equiped weapon glow
 
Hello.

I saw a server that have glow in player's equiped weapons, you can view other players with glow only in the weapon (not entire body).

How can I do that?

As I know set_user_rendering is only for players....

iceeedr 07-03-2018 09:36

Re: Set equiped weapon glow
 
Quote:

Originally Posted by Ghosted (Post 2600729)
FM_SetModel is for dropped weapons.

Yes, I deleted the answer as soon as I realized

Ghosted 07-03-2018 09:43

Re: Set equiped weapon glow
 
Quote:

Originally Posted by iceeedr (Post 2600730)
Yes, I deleted the answer as soon as I realized

I deleted answer as soon as i read this post.

Ghosted 07-03-2018 09:48

Re: Set equiped weapon glow
 
its very easy. register clcmd and in function get players weapon (first check if is alive), to get players' weapon you need privatedata offset of active item (i think its 373) and get it
Code:

#define m_pActiveItem 373

new Weapon = get_pdata_cbase(id, m_pActiveItem);

Bam! now u can set weapons rendering using fm_set_rendering or such thing.

[PS: I dont think if this will work lul]
[Cause weapon has not its model and you see players weaponmodel which is players variable and that means you must set rendering on player]

esenrik 07-03-2018 11:33

Re: Set equiped weapon glow
 
Quote:

Originally Posted by Ghosted (Post 2600735)
its very easy. register clcmd and in function get players weapon (first check if is alive), to get players' weapon you need privatedata offset of active item (i think its 373) and get it
Code:

#define m_pActiveItem 373

new Weapon = get_pdata_cbase(id, m_pActiveItem);

Bam! now u can set weapons rendering using fm_set_rendering or such thing.

[PS: I dont think if this will work lul]
[Cause weapon has not its model and you see players weaponmodel which is players variable and that means you must set rendering on player]

373 will works in linux?

Ghosted 07-03-2018 11:37

Re: Set equiped weapon glow
 
Quote:

Originally Posted by esenrik (Post 2600757)
373 will works in linux?

Will this even work? (:D)
But anyway i think amxx automatically sets pdata for linux/windows.

CrazY. 07-03-2018 14:07

Re: Set equiped weapon glow
 
No, you can't set glow via modules in player weapon view model. You will need to add a glowed sub-model in v_model of the weapon and after do some trick with SVC_WEAPONANIM.

m_pActiveItem is 373 and the diff for linux is 5, so basically

Code:
const m_pActiveItem = 373; const XO_PLAYER = 5; [get|set]_pdata_cbase(player_id, m_pActiveItem, XO_PLAYER);

esenrik 07-03-2018 18:08

Re: Set equiped weapon glow
 
Quote:

Originally Posted by Ghosted (Post 2600735)
its very easy. register clcmd and in function get players weapon (first check if is alive), to get players' weapon you need privatedata offset of active item (i think its 373) and get it
Code:

#define m_pActiveItem 373

new Weapon = get_pdata_cbase(id, m_pActiveItem);

Bam! now u can set weapons rendering using fm_set_rendering or such thing.

[PS: I dont think if this will work lul]
[Cause weapon has not its model and you see players weaponmodel which is players variable and that means you must set rendering on player]

Tested and not working

Ghosted 07-04-2018 03:43

Re: Set equiped weapon glow
 
Quote:

Originally Posted by esenrik (Post 2600849)
Tested and not working

Ofc, i said why.

esenrik 07-04-2018 13:46

Re: Set equiped weapon glow
 
Any way?


All times are GMT -4. The time now is 12:46.

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