Function don't work.
#3

Yes. I just want to get closest car, but server always found, but it's realy not.

Код:
stock GetClosestVehicle(playerid, Float:range)
{
    SAVEVEHICLEID[ playerid ] = 0;
	new Float:DISTANCE;
    GetPlayerPos(playerid, SavePos[ playerid ][ 0 ], SavePos[ playerid ][ 1 ], SavePos[ playerid ][ 2 ]);

    for(new ivh = 1; ivh < MAX_VEHICLES; ivh ++)
    {
        DISTANCE = GetVehicleDistanceFromPoint(CikleSave[ playerid ], SavePos[ playerid ][ 0 ], SavePos[ playerid ][ 1 ], SavePos[ playerid ][ 2 ]);
        
        if(DISTANCE <= range )
        {
            SAVEVEHICLEID[ playerid ] = ivh;
            break;
        }
    }
}
i try to check if

Код:
if( SAVEVEHICLEID[ playerid ] == 0 )
This will be, if there is no near vehicle in 7 metres, but this never happen there is always car. Then i try to print and i get distance 0, then this check will work:

Код:
if(DISTANCE <= range )
      {
And this happen for vehicleid 1.
Reply


Messages In This Thread
Function don't work. - by budelis - 31.10.2012, 11:56
Re: Function don't work. - by [HK]Ryder[AN] - 31.10.2012, 12:00
Re: Function don't work. - by budelis - 31.10.2012, 12:17
Re: Function don't work. - by [HK]Ryder[AN] - 31.10.2012, 12:20
Re: Function don't work. - by [NYO] Kael - 31.10.2012, 12:26
Re: Function don't work. - by budelis - 31.10.2012, 12:27
Re: Function don't work. - by [HK]Ryder[AN] - 31.10.2012, 12:33

Forum Jump:


Users browsing this thread: 1 Guest(s)