Detect if player1 and player2 is aiming each other?
Hello, greetings.
I am working on a plugin, that use the features that I mentioned on the title. Is there any possible way to do this? If so, is it like; PHP Code:
|
Re: Detect if player1 and player2 is aiming each other?
Simply get both players' aiming entity and see if they are equal.
PHP Code:
|
Re: Detect if player1 and player2 is aiming each other?
Why not
iEnt[0] == id2 && iEnt[1] == id ? |
Re: Detect if player1 and player2 is aiming each other?
Quote:
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? |
Re: Detect if player1 and player2 is aiming each other?
Yeah, my bad. I fixed my code.
|
Re: Detect if player1 and player2 is aiming each other?
Sorry for driving this out from the main context.
If I want the 'id2' to be an enemy to 'id', should I do PHP Code:
|
Re: Detect if player1 and player2 is aiming each other?
Quote:
if( get_user_team( id1 ) != get_user_team( id2 ) ) |
Re: Detect if player1 and player2 is aiming each other?
Quote:
I know how to distinguish the stance by using the cs_get_user_team native. What I am trying to explain is actually how I can properly/exactly catch the index of the enemy( as I don't have a specific index( id2 ) for the enemy in my function...), is it simply by making the new 'id2'? PHP Code:
Sorry for any inconvenient... |
Re: Detect if player1 and player2 is aiming each other?
PHP Code:
|
Re: Detect if player1 and player2 is aiming each other?
Like this?
PHP Code:
My enormous apology, I am not being rude or picky. It's just that I'd like to hear your opinion on your code... |
| All times are GMT -4. The time now is 20:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.