Raised This Month: $ Target: $400
 0% 

Check if user is aiming at someone?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AwesomeMan
Member
Join Date: Jun 2013
Old 08-30-2013 , 18:14   Check if user is aiming at someone?
Reply With Quote #1

How would I check, at certain time, if a user is aiming at someone (and get their index) and if possible distance.
F

Last edited by AwesomeMan; 08-30-2013 at 18:49.
AwesomeMan is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 08-30-2013 , 19:24   Re: Check if user is aiming at someone?
Reply With Quote #2

distance = get_user_aiming( )
akcaliberg is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 08-31-2013 , 04:22   Re: Check if user is aiming at someone?
Reply With Quote #3

Code:
/* If player doesn't hit at anything function returns 0.0, * in other case the distance between hit point and player is returned. * If player is aiming at another player then the id and part of body are set. */ native Float:get_user_aiming(index,&id,&body,dist=9999);

Last edited by SpeeDeeR; 08-31-2013 at 04:22.
SpeeDeeR is offline
AwesomeMan
Member
Join Date: Jun 2013
Old 08-31-2013 , 06:41   Re: Check if user is aiming at someone?
Reply With Quote #4

Thank you, will try that. But what does the "dist=9999" do?
AwesomeMan is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-31-2013 , 07:13   Re: Check if user is aiming at someone?
Reply With Quote #5

It sets a maximum limit, if nothing is set default is 9999.
__________________
Black Rose 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:05.


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