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

[ H3LP ] Easy Way Detect Aim at Items


Post New Thread Reply   
 
Thread Tools Display Modes
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-23-2017 , 03:03   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #11

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
Thanks and, is it good to also check if the entity is valid? pev_valid (iEnt)
DarthMan is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-23-2017 , 04:42   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #12

You can check if its greater than zero its better
__________________
@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-25-2017 , 14:05   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #13

Quote:
Originally Posted by Natsheh View Post
You can check if its greater than zero its better
Code:
public fw_TraceLine_Post(Float: fStart[3], Float: fEnd[3], iConditions, iID, iTrace) {     if (!is_user_alive(iID))         return FMRES_IGNORED;           new iEnt = g_iAimEnt[iID];           if (iEnt <= 0)     {         iEnt = get_tr2(iTrace, TR_pHit);                   if (!isValidEnt(iEnt))             return FMRES_IGNORED;                   g_iAimEnt[iID] = iEnt;     }           return FMRES_IGNORED; }

What can be wrong? I use g_iAimEnt[iID] on the EntityAim stock which basically just checks the distance between the player and the entity using get_distance but it reports the entity as being invalid in console so the problem must be on FakeMeta traceline.
DarthMan is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-25-2017 , 14:32   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #14

Traceline ignores SOLID_TRIGGER entities. I'm not sure why you keep ignoring that.

Also you are checking ent < 0 which means invalid entity. It should be >
__________________

Last edited by HamletEagle; 09-25-2017 at 14:33.
HamletEagle is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-25-2017 , 14:55   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #15

Quote:
Originally Posted by HamletEagle View Post
Traceline ignores SOLID_TRIGGER entities. I'm not sure why you keep ignoring that.

Also you are checking ent < 0 which means invalid entity. It should be >
No, it should be < becuz it checks this only if the entity is not valid.
How can I do it for SOLID_TRIGGER? Some ppl say it's 100% impossible, but Drunken did it on his entmod and u can move SOLID_TRIGGER entities.

Last edited by DarthMan; 09-25-2017 at 14:56.
DarthMan is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 09-25-2017 , 17:13   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #16

Quote:
Originally Posted by DarthMan View Post
No, it should be < becuz it checks this only if the entity is not valid.
You don't know what you're talking about
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-26-2017 , 00:58   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #17

It can be done. Search in my posts.
__________________
HamletEagle is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 09-26-2017 , 02:57   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #18

Quote:
Originally Posted by HamletEagle View Post
It can be done. Search in my posts.
Where ? There are a lot of posts and ti can take hours to find what I need. Maybe u can easely link me the page to have a look.
DarthMan is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-26-2017 , 03:01   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #19

Use ctrl + f then enter a keyword
__________________
@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
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 09-26-2017 , 03:14   Re: [ H3LP ] Easy Way Detect Aim at Items
Reply With Quote #20

Quote:
Originally Posted by HamletEagle View Post
It can be done. Search in my posts.
he is thinking your posts on alliedmodders and natsheh is telling him to search in a specific code. tell him which of your plugin you are talking about.
__________________
And I Am Back.

Last edited by TheSpaniard; 09-26-2017 at 05:16.
TheSpaniard 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 20:22.


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