Could I detect...
#1

Hello,

Could I detect the vehicle's looking at?
(ex: GetVehicleLookingAt(vehicleid, x, y, z) ) ?
Reply
#2

maybe you can use, if(IsplayerInAnyVehicle....... and https://sampwiki.blast.hk/wiki/GetPlayerCameraFrontVector
Reply
#3

what if I want to move an object toward the vehicle looking at?
Reply
#4

Refer to https://sampforum.blast.hk/showthread.php?tid=413556
Reply
#5

use this code as a stock

pawn Код:
stock GetVehiclePos(playerid, vehicleid)
{
 if(IsPlayerInAnyVehicle(playerid))
{
new Float:x,Float:y,Float:z,Float:a,Float:X,Float:y;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
X = x + (8 * floatsin(a,degrees));
Y = y + (8 * floatcos(a,degrees));
CreateObject(00000,X,Y,z,0,0,0);
}
return 1;
}
Reply
#6

Quote:
Originally Posted by DanLore
Посмотреть сообщение
I'm not asking for a script.
I'm saying that could I detect so...
Reply
#7

You'll need to get camera vectors (GetPlayerCameraPos + GetPlayerCameraFrontVector).

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

https://sampforum.blast.hk/showthread.php?tid=140765
Reply
#8

Quote:
Originally Posted by MP2
Посмотреть сообщение
You'll need to get camera vectors (GetPlayerCameraPos + GetPlayerCameraFrontVector).

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

https://sampforum.blast.hk/showthread.php?tid=140765
No, he asks for the vehicle lookat...
Simply use: GetVehicleZAngle
Reply
#9

Vehicles don't have eyes so they can't 'look' at a place, so I assumed he meant the player's camera.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)