AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check if user is aiming at someone? (https://forums.alliedmods.net/showthread.php?t=225013)

AwesomeMan 08-30-2013 18:14

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

akcaliberg 08-30-2013 19:24

Re: Check if user is aiming at someone?
 
distance = get_user_aiming( )

SpeeDeeR 08-31-2013 04:22

Re: Check if user is aiming at someone?
 
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);

AwesomeMan 08-31-2013 06:41

Re: Check if user is aiming at someone?
 
Thank you, will try that. But what does the "dist=9999" do?

Black Rose 08-31-2013 07:13

Re: Check if user is aiming at someone?
 
It sets a maximum limit, if nothing is set default is 9999.


All times are GMT -4. The time now is 19:05.

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