Checking if player is facing an object
#6

maybe you can just use

pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
mix it with isplayerinrangeofpoint and make sure that the x and y coordinates are the coordinates of the object, then it should check if the object is in front of you i think
Reply


Messages In This Thread
Checking if player is facing an object - by JaKe Elite - 27.07.2012, 11:00
Re: Checking if player is facing an object - by Misiur - 27.07.2012, 11:13
Re: Checking if player is facing an object - by JaKe Elite - 27.07.2012, 11:35
Re: Checking if player is facing an object - by Kar - 27.07.2012, 11:38
Re: Checking if player is facing an object - by JaKe Elite - 27.07.2012, 11:39
Re: Checking if player is facing an object - by AIped - 27.07.2012, 12:30
Re: Checking if player is facing an object - by JaKe Elite - 27.07.2012, 12:38
Re: Checking if player is facing an object - by Mauzen - 27.07.2012, 12:55
Re: Checking if player is facing an object - by JaKe Elite - 27.07.2012, 13:07
Re: Checking if player is facing an object - by JaKe Elite - 27.07.2012, 13:54

Forum Jump:


Users browsing this thread: 1 Guest(s)