IsPlayerLookAt Function
#3

I want get if player look at house entrance

here is what I done so far, haven't tested yet.
pawn Код:
public IsPlayerLookAt(playerid,Float:range,Float:x,Float:y,Float:z)
{
    if(IsPlayerInRangeOfPoint(playerid,range,x,y,z))
    {
        new Float:Face,Float:FaceX,Float:FaceY,Float:FaceZ;
        GetPlayerPos(playerid,FaceX,FaceY,FaceZ);
        GetPlayerFacingAngle(playerid,Face);
        if(FaceX > 0 && FaceY > 0) { if(Face > -1 && Face < 91) { return 1; } }
        if(FaceX < 0 && FaceY > 0) { if(Face > 89 && Face < 181) { return 1; } }
        if(FaceX < 0 && FaceY < 0) { if(Face > 179 && Face < 271) { return 1; } }
        if(FaceX > 0 && FaceY < 0) { if(Face > 269 && Face < -1) { return 1; } }
    }
    return 0;
}
Reply


Messages In This Thread
IsPlayerLookAt Function - by Voldemort - 23.08.2010, 14:30
Re: IsPlayerLookAt Function - by boelie - 23.08.2010, 14:52
Re: IsPlayerLookAt Function - by Voldemort - 23.08.2010, 14:57
Re: IsPlayerLookAt Function - by boelie - 23.08.2010, 15:01
Re: IsPlayerLookAt Function - by Claude - 23.08.2010, 15:06
Re: IsPlayerLookAt Function - by Voldemort - 23.08.2010, 15:18
Re: IsPlayerLookAt Function - by Nero_3D - 23.08.2010, 16:32
Re: IsPlayerLookAt Function - by Voldemort - 23.08.2010, 18:43
Re: IsPlayerLookAt Function - by Nero_3D - 23.08.2010, 19:49

Forum Jump:


Users browsing this thread: 1 Guest(s)