GetWhereIsPlayerLook
#1

I have this:
pawn Код:
stock IsPlayerLookingAtPoint(playerid,Float:X,Float:Y,Float:Z,Float:ViewWidth,Float:ViewHeight)
{
    new Float:cx,Float:cy,Float:cz,Float:pa1,Float:pa2,Float:ca1,Float:ca2,Float:px,Float:py,Float:pz;
    GetPlayerCameraFrontVector(playerid,cx,cy,cz);
    GetPlayerPos(playerid,px,py,pz);
    pz+=2.0;
    cx=floatadd(cx,px);
    cy=floatadd(cy,py);
    cz=floatadd(cz,pz);
    pa1=atan2(X-px,Y-py);
    if(pa1>360)pa1=floatsub(pa1,360);
    if(pa1<0)pa1=floatadd(pa1,360);
    pa2=atan2(Y-py,Z-pz);
    if(pa2>360)pa2=floatsub(pa2,360);
    if(pa2<0)pa2=floatadd(pa2,360);
    ca1=atan2(cx-px,cy-py);
    if(ca1>360)ca1=floatsub(ca1,360);
    if(ca1<0)ca1=floatadd(ca1,360);
    ca2=atan2(cy-py,cz-pz);
    if(ca2>360)ca2=floatsub(ca2,360);
    if(ca2<0)ca2=floatadd(ca2,360);
    if((ca1>(pa1-ViewWidth))&&(ca1<(pa1+ViewWidth))&&(ca2>(pa2-ViewHeight))&&(ca2<(pa2+ViewHeight)))return 1;
    if((pa1-ViewWidth)<0)
    {
        ca1-=360.0;
        if((ca1>(pa1-ViewWidth))&&(ca1<(pa1+ViewWidth))&&(ca2>(pa2-ViewHeight))&&(ca2<(pa2+ViewHeight)))return 1;
    }
    if((pa1+ViewWidth)>360)
    {
        ca1+=360.0;
        if((ca1>(pa1-ViewWidth))&&(ca1<(pa1+ViewWidth))&&(ca2>(pa2-ViewHeight))&&(ca2<(pa2+ViewHeight)))return 1;
    }
    return 0;
}
from https://sampforum.blast.hk/showthread.php?tid=136868
but I need this plaese:
pawn Код:
GetWhereIsPlayerLook(playerid, Float:X,Float:Y,Float:Z,Float:ViewWidth,Float:ViewHeight)
Reply


Messages In This Thread
GetWhereIsPlayerLook - by cca - 12.10.2010, 12:18
Re: GetWhereIsPlayerLook - by DevilG - 12.10.2010, 12:50
Re: GetWhereIsPlayerLook - by Mike_Peterson - 12.10.2010, 13:01
Re: GetWhereIsPlayerLook - by cca - 12.10.2010, 13:09
Re: GetWhereIsPlayerLook - by cca - 12.10.2010, 18:42
Re: GetWhereIsPlayerLook - by cca - 13.10.2010, 10:21
Re: GetWhereIsPlayerLook - by Hiddos - 13.10.2010, 11:34
Re: GetWhereIsPlayerLook - by CracK - 13.10.2010, 11:37
Re: GetWhereIsPlayerLook - by cca - 13.10.2010, 12:09
Re: GetWhereIsPlayerLook - by cca - 13.10.2010, 16:01

Forum Jump:


Users browsing this thread: 1 Guest(s)