Raised This Month: $ Target: $400
 0% 

Solved Detect if player1 and player2 is aiming each other?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Kotoamatsukami
Member
Join Date: Jan 2017
Location: Malaysia
Old 03-01-2017 , 14:41   Re: Detect if player1 and player2 is aiming each other?
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Simply get both players' aiming entity and see if they are equal.

PHP Code:
new iEnt[2], iBody
get_user_aiming
(idiEnt[0], iBody)
get_user_aiming(id2iEnt[1], iBody)

if(
is_user_connected(iEnt[0]) && is_user_connected(iEnt[1]) && iEnt[0] == iEnt[1])
{
    
// both players are aiming at each other

Pardon me...
But, isn't your code will only operate if both 'id' and 'id2' are aiming at the same entity( not each other )?
For instant, I thought PRoSToTeM@'s lines should work if they are aiming each other?

Last edited by Kotoamatsukami; 03-01-2017 at 14:42.
Kotoamatsukami is offline
 



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:46.


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