For that you need to code it yourself, something like this:
function PlayerLookingAt (e, dist, fov)
local Ent = g_Entity[e]
if Ent == nil then return false end
dist = dist or 3000
fov = fov or 1
local Dx = Ent.x - g_PlayerPosX
local Dz = Ent.z - g_PlayerPosZ
if (Dx*Dx + Dz*Dz) > dist*dist then return false end
local function limitAngle (Angle)
if Angle <= 0 then
Angle = 360 + Angle
elseif Angle > 360 then
Angle = Angle - 360
end
return Angle
end
local angle = limitAngle(math.atan2(Dx, Dz) * (180.0 / math.pi))
local pAng = g_PlayerAngY
while pAng < 0 or pAng > 360 do
if pAng <= 0 then
pAng = 360 + pAng
elseif pAng > 360 then
pAng = pAng - 360
end
end
local L = limitAngle(angle - fov / 2)
local R = limitAngle(angle + fov / 2)
if L < R and (pAng > L and pAng < R) or
L > R and (pAng > L or pAng < R) then
return true
else
return false
end
end
Just have:
if PlayerLookingAt (e) then PromptLocal(e, "<text in here>") end
Been there, done that, got all the T-Shirts!