Raised This Month: $ Target: $400
 0% 

find if player is aiming at another player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-24-2009 , 13:51   find if player is aiming at another player
Reply With Quote #1

I'm trying to figure out how to code my plugin so that when a player looks at another player (!is_user_bot) it does an emit_sound. I was unsure how to do this using stock fm_get_aim_origin(index, Floatrigin[3]) and then checking if a !is_user_bot is located in that origin. I was also wondering if there is just a simpler way instead of having checks every 0.1 seconds.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-24-2009 , 13:55   Re: find if player is aiming at another player
Reply With Quote #2

get_user_aiming
__________________
xPaw is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-24-2009 , 14:43   Re: find if player is aiming at another player
Reply With Quote #3

Will that be able to check if there is a player is in sight?
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-24-2009 , 15:01   Re: find if player is aiming at another player
Reply With Quote #4

There are plugins that use events for when a player aims at another, such as an XP mod.
Look in the source code and find them.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-24-2009 , 15:23   Re: find if player is aiming at another player
Reply With Quote #5

K, will do, thanks
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-24-2009 , 18:46   Re: find if player is aiming at another player
Reply With Quote #6

I'm not getting any errors and so far it works good except I would like a way to delay in between the sounds because right now it just plays them on top of each other. Like i would like it to register the StatusValue once and then stop registering it for the activated id for 5 seconds or so.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-24-2009 , 19:44   Re: find if player is aiming at another player
Reply With Quote #7

Like how can i stop the register_event from working for a period of time
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-25-2009 , 01:07   Re: find if player is aiming at another player
Reply With Quote #8

Quote:
Originally Posted by Tirant View Post
Like how can i stop the register_event from working for a period of time
Use a global variable to check, or use states (more advanced).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 07-25-2009 , 01:22   Re: find if player is aiming at another player
Reply With Quote #9

Nevermind, i figure it out by myself. I used a system of checking a variable the event would run == 1 and then after the sound it'd change the variable to 2 and set task to another public which would change the variable back to 1, thus delaying the sounds.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant 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 18:17.


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