Script Problem
#1

Hello

When i add
pawn Код:
stock IsPlayerAiming(playerid, aimid)
{
    // Not my function, can't remember who made it though.
    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 am getting this warning
warning 219: local variable "Distance" shadows a variable at a preceding level

/cake

Reply


Messages In This Thread
Script Problem - by Daniel_Truk - 16.04.2010, 16:59
Re: Script Problem - by brett7 - 16.04.2010, 17:03
Re: Script Problem - by Daniel_Truk - 16.04.2010, 17:12
Re: Script Problem - by brett7 - 16.04.2010, 17:13
Re: Script Problem - by Daniel_Truk - 16.04.2010, 17:17
Re: Script Problem - by Daniel_Truk - 16.04.2010, 20:50
Re: Script Problem - by Mikep. - 16.04.2010, 20:55

Forum Jump:


Users browsing this thread: 1 Guest(s)