08.06.2011, 18:55
(
Последний раз редактировалось 0ne; 11.06.2011 в 18:58.
)
I got lubys function
How could i check if there are 2 aimers at one player?
edit: check my below posts
pawn Код:
stock IsPlayerAiming(playerid, aimid)
{
// Luby's function.
new Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2;
GetPlayerPos(playerid, X1, Y1, Z1);
GetPlayerPos(aimid, X2, Y2, Z2);
new Float:Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
if(Distance < 100)
{
new Float:A;
GetPlayerFacingAngle(playerid, A);
X1 += (Distance * floatsin(-A, degrees));
Y1 += (Distance * floatcos(-A, degrees));
Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
if(Distance <= 2.0)
{
return true;
}
}
return false;
}
edit: check my below posts