27.04.2014, 04:45
As the title says, could someone explain it?
Can it be used, to detect if a player is looking at another player, or not?
Like.
or something like that? xd
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' ..
}
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");
}