Problems with a function
#6

Код HTML:
GetClosestVehicle(playerid, Float:range) {

	new Float:POS[3];
	if(GetPlayerPos(playerid, POS[0], POS[1], POS[2])) // check is player valid + get player pos
	{
		new Float:distance, cveh;
		for(new v; v < MAX_VEHICLES; v++)
		{
			if(!IsValidVehicle(v)) return INVALID_VEHICLE_ID;
			distance = GetVehicleDistanceFromPoint(v, POS[0], POS[1], POS[2]);
			if(distance <= range) cveh = v;
		}
		return cveh;
	}
	return false; // smthng wrong
}
Reply


Messages In This Thread
Problems with a function - by Antenastyle - 19.04.2017, 13:27
Re: Problems with a function - by Marricio - 19.04.2017, 13:33
Re: Problems with a function - by Antenastyle - 19.04.2017, 13:41
Re: Problems with a function - by Marricio - 19.04.2017, 13:47
Re: Problems with a function - by Antenastyle - 19.04.2017, 13:51
Re: Problems with a function - by JustNothing - 19.04.2017, 14:06
Re: Problems with a function - by Antenastyle - 19.04.2017, 14:30
Re: Problems with a function - by JustNothing - 19.04.2017, 15:45
Re: Problems with a function - by Antenastyle - 19.04.2017, 18:05
Re: Problems with a function - by Logic_ - 19.04.2017, 18:17

Forum Jump:


Users browsing this thread: 3 Guest(s)