Raised This Month: $ Target: $400
 0% 

get_user_aiming,in range?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-16-2007 , 12:56   get_user_aiming,in range?
Reply With Quote #1

This get the user id when aimed but how do i make it
only if target is in range...

Code:
 
public Target(id) 
{ 
    new aimed, body, team1, team2; 
    get_user_aiming(id, aimed, body); 
    team1 = get_user_team(id); 
    team2 = get_user_team(aimed); 
     
    if(team1 == team2) 
    { 
     
    } 
}
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
Miczu
Member
Join Date: Jul 2007
Old 09-16-2007 , 13:42   Re: get_user_aiming,in range?
Reply With Quote #2

You could calculate distance between players by checking both origins (get_user_origin).

I'm not a PRO so wait for some better idea, it should be ther :p
Miczu is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 09-17-2007 , 01:27   Re: get_user_aiming,in range?
Reply With Quote #3

Code:
new distance
get_user_aiming(id, aimed, body, distance);

if(distance < YOUR_RANGE)
    //do stuff
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-17-2007 , 22:26   Re: get_user_aiming,in range?
Reply With Quote #4

Emp`, the distance parameter is the number of units to limit the check to. So all he needs to do is set that (the default is 9999). The return value of get_user_aiming is the distance between the player and the hit object.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply


Thread Tools
Display Modes

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 16:09.


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