AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need an event (https://forums.alliedmods.net/showthread.php?t=130017)

mottzi 06-19-2010 08:30

Need an event
 
Hello guys =)

How is the event called, witch is fired when anybody is aiming at a player?
I need the id of the player im aiming at.

Hope u can help me.


Mottzi

hzqst 06-19-2010 11:49

Re: Need an event
 
witch? in L4D?

hook FM_TraceLine and

get_tr(TR_pHit) to get the entity you are aiming at

mottzi 06-19-2010 14:22

Re: Need an event
 
no, i want the id of the player im aiming. i dont want a entity

ConnorMcLeod 06-19-2010 14:24

Re: Need an event
 
See StatusText and StatusValue, but it's depending on mp_playerid value.
Otherwise see get_user_aiming native, but you gonna need to fire it quite often.

mottzi 06-19-2010 14:42

Re: Need an event
 
can you give me an example how to do this?

In the doc stands if a player aims to another player get_user_aiming returns the id (2. paramather)

RedRobster 06-19-2010 15:44

Re: Need an event
 
After looking at the command, it looks as if you could do this.

PHP Code:

new targetid
get_user_aiming
(idtargetid

id would be the id of the player who is aiming
targetid is the id of who the player is aiming at

grimvh2 06-19-2010 17:19

Re: Need an event
 
Buh im doing this on prethink.

mottzi 06-19-2010 17:33

Re: Need an event
 
Quote:

Originally Posted by RedRobster (Post 1213682)
After looking at the command, it looks as if you could do this.

PHP Code:

new targetid
get_user_aiming
(idtargetid

id would be the id of the player who is aiming
targetid is the id of who the player is aiming at

thank you very much :D


All times are GMT -4. The time now is 14:53.

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