Raised This Month: $51 Target: $400
 12% 

[ H3LP ] Easy Way Detect Aim at Items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-20-2017 , 12:13   [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #1

Hello. Is there an easy way to detect if a player aims at items like item_healthkit, item_longjump etc ? It doesn't seem to work fine with get_user_aiming, but with that method I can aim at brush entities and some models that are cycles with models as well.
DarthMan is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-20-2017 , 13:19   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #2

Because those are SOLID_TRIGGER I believe.
klippy is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-20-2017 , 13:40   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #3

Quote:
Originally Posted by KliPPy View Post
Because those are SOLID_TRIGGER I believe.
I see, but with original entmod by Drunken or whatever his name was could detect SOLID_TRIGGER entities and move them. Any way I can achieve that as well? Maybe you can show me an example.

Last edited by DarthMan; 09-20-2017 at 13:41.
DarthMan is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-20-2017 , 14:18   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #4

You can search ...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-20-2017 , 14:27   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
You can search ...
Yeah, but I ahven't found anything usefull.
DarthMan is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-20-2017 , 17:46   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #6

https://forums.alliedmods.net/showth...25#post2528125
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-21-2017 , 04:14   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #7

Quote:
Originally Posted by PRoSToTeM@ View Post
So is this method gonna work fine if I wanna move or copy an item that I am aiming at?
DarthMan is offline
Xiaobaibai
Junior Member
Join Date: Dec 2016
Old 09-22-2017 , 04:10   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #8

An efficient way here:

Code:
....
register_forward(FM_TraceLine, "fw_TraceLine_Post", 1)
....

public fw_TraceLine_Post( Float:vecStart[3], Float:vecEnd[3], noMonsters, pentToSkip )
{
	new id = pentToSkip; // player who is aiming at
	if(!is_user_alive(id)) 
		return

	new iEntity = get_tr(TR_pHit) // the object(entity) that the player aims at

}
No more TraceLine == No more lag
Xiaobaibai is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-22-2017 , 05:33   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #9

Quote:
Originally Posted by Xiaobaibai View Post
An efficient way here:

Code:
....
register_forward(FM_TraceLine, "fw_TraceLine_Post", 1)
....

public fw_TraceLine_Post( Float:vecStart[3], Float:vecEnd[3], noMonsters, pentToSkip )
{
	new id = pentToSkip; // player who is aiming at
	if(!is_user_alive(id)) 
		return

	new iEntity = get_tr(TR_pHit) // the object(entity) that the player aims at

}
No more TraceLine == No more lag
Won't work with weaponbox entity.
__________________
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-22-2017 , 06:10   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #10

It will work if you did a tracemodel
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 03:09.


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