SA-MP Forums Archive
Getting position where player aims - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting position where player aims (/showthread.php?tid=307202)



Getting position where player aims - Mike_Peterson - 29.12.2011

Hey guys, I'm curious, is there a way to get the position where the player's crosshair is looking at (while aiming for example)? or to check if a player aims at another player.
I'm remaking Battlefield 2 on a sa-mp server, and I want to make the 'spot' function, so if someone aims at someone else, presses a button, the player gets spotted on the map (like BF2).
But I need to know either where the player's crosshair is aiming at, or when aiming at a person.
Thanks in advance


Re: Getting position where player aims - Mike_Peterson - 30.12.2011

Dammed! This is the first time since like a half year that I ask something on sa-mp forums, and now i have to...
'Bump'


Re: Getting position where player aims - Spooky - 30.12.2011

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer

This will help


Re: Getting position where player aims - HuSs3n - 30.12.2011

i beleive

Код:
GetPlayerTargetPlayer(playerid);
https://sampwiki.blast.hk/wiki/GetPlayerTargetPlayer

would help you

or this
OnPlayerTargetPlayer(playerid,newtarget,oldtarget)
https://sampforum.blast.hk/showthread.php?tid=293558

witch is being called when someone aims at the ohter
Код:
public OnPlayerTargetPlayer(playerid,newtarget,oldtarget)
{
   SetPlayerMarkerForPlayer............
}



Re: Getting position where player aims - Mike_Peterson - 30.12.2011

Quote:
Originally Posted by HuSs3n
Посмотреть сообщение
i beleive

Код:
GetPlayerTargetPlayer(playerid);
https://sampwiki.blast.hk/wiki/GetPlayerTargetPlayer

would help you

or this
OnPlayerTargetPlayer(playerid,newtarget,oldtarget)
https://sampforum.blast.hk/showthread.php?tid=293558

witch is being called when someone aims at the ohter
Код:
public OnPlayerTargetPlayer(playerid,newtarget,oldtarget)
{
   SetPlayerMarkerForPlayer............
}
Exactly what i needed, thank you.