Get player aiming at
#1

hey, here is a short question:

Is there a way to get the coцrdinates of where the player is aiming at?

I think MTA found a way (with the laser-pointer in the map editor).
Reply
#2

GetPlayerFacingAngle and use of some sinus and cosinus
Reply
#3

It's not possible yet.
Reply
#4

Quote:
Originally Posted by paytas
It's not possible yet.
it is i saw it in a server, you need to script it like dice7 told you
Reply
#5

thats bs, u can't get where the payer is aiming at in 3d, only 2d -> useless.
Reply
#6

paytas has a point. btw, script for telling you where you aim, 2d only. This is useful when you have a car spawn command
and with this you can make the car spawn right infront of you

pawn Code:
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
CreateVehicle(411, X, Y, Z, 0.0, -1, -1, 600);
Reply
#7

Yes I have seen that piece of code before, but it doesn't tell me where I am aiming at.
Well, to bad if it ain't possible.
Reply
#8

Quote:
Originally Posted by Rickk
Yes I have seen that piece of code before, but it doesn't tell me where I am aiming at.
Well, to bad if it ain't possible.
pawn Code:
new Float:X,Float:Y,Float:Z,Float:A, string[40];
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
X += (5 * floatsin(-A, degrees));
Y += (5 * floatcos(-A, degrees));
format(string, sizeof(string), "You are aiming at X:%2.f, Y:%2.f", X, Y);
SendClientMessage(playerid, string);
CreateVehicle(411, X, Y, Z, 0.0, -1, -1, 600);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)