27.04.2013, 09:53
Hello,
Could I detect the vehicle's looking at?
(ex: GetVehicleLookingAt(vehicleid, x, y, z) ) ?
Could I detect the vehicle's looking at?
(ex: GetVehicleLookingAt(vehicleid, x, y, z) ) ?
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;
}
You'll need to get camera vectors (GetPlayerCameraPos + GetPlayerCameraFrontVector).
https://sampwiki.blast.hk/wiki/GetPlayerCameraFrontVector https://sampforum.blast.hk/showthread.php?tid=140765 |