i want to create IsPlayerAimHead Function, PLZ help...
#1

I have this function:
Код:
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 < 0.5)
        {
          return true;
        }
    }
    return false;
}
I want to change to code here to check if the player is aiming to the another player's head...
Please help.
Reply


Messages In This Thread
i want to create IsPlayerAimHead Function, PLZ help... - by or_yagoda - 26.02.2010, 08:28
Re: i want to create IsPlayerAimHead Function, PLZ help... - by Rzzr - 26.02.2010, 09:33
Re: i want to create IsPlayerAimHead Function, PLZ help... - by BlackFoX - 26.02.2010, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)