Could someone explaing me how "GetXYInFrontOfPlayer" works?
#1

As the title says, could someone explain it?
pawn Код:
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));
    return 1; //Needed this because if 'if' ..
}
Can it be used, to detect if a player is looking at another player, or not?
Like.

pawn Код:
new Float:X, Float:Y, Float:Z
        GetPlayerPos(playerid, X, Y, Z);
        if(GetXYInFrontOfPlayer(issuerid, X, Y, 5))
        {
            SendClientMessage(issuerid, -1, "no aimbot");
        }
        else
        {
            SendClientMessage(issuerid, -1, "aimbot");
        }
or something like that? xd
Reply
#2

Edit: sorry i was posting ur post answer but unfortunately i pasted wrong post to ur thread.
As i know this function is use for create objects in front of player and this function is based on 2D which will check according to straight line instead of a plane , n i m not sure but think that u may get success .
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
In addition to that,

Polar co-ordinates
Co-ordinate system
Polar to cartesian conversion
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)