AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   find if player is aiming at another player (https://forums.alliedmods.net/showthread.php?t=98327)

Tirant 07-24-2009 13:51

find if player is aiming at another player
 
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, Float:origin[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.

xPaw 07-24-2009 13:55

Re: find if player is aiming at another player
 
get_user_aiming

Tirant 07-24-2009 14:43

Re: find if player is aiming at another player
 
Will that be able to check if there is a player is in sight?

Exolent[jNr] 07-24-2009 15:01

Re: find if player is aiming at another player
 
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.

Tirant 07-24-2009 15:23

Re: find if player is aiming at another player
 
K, will do, thanks

Tirant 07-24-2009 18:46

Re: find if player is aiming at another player
 
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.

Tirant 07-24-2009 19:44

Re: find if player is aiming at another player
 
Like how can i stop the register_event from working for a period of time

Exolent[jNr] 07-25-2009 01:07

Re: find if player is aiming at another player
 
Quote:

Originally Posted by Tirant (Post 881059)
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).

Tirant 07-25-2009 01:22

Re: find if player is aiming at another player
 
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.


All times are GMT -4. The time now is 18:17.

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