Calculate RZ from X and Y
#10

Just do something like this......

Код:
Float:GetDistanceBetweenPoints3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2){
    return VectorSize(x1-x2,y1-y2,z1-z2);
}

SaveModelsInRange(modelid, Float:x, Float:y, Float:z, Float:range, file[])
{
	if(isnull(file))
	    return 0;

	new File:f, tmp[128];

	f = fopen(file, io_write);


	for(new i = 0; i < sizeof(SearchData); i++)
	{
	    if( (modelid == SearchData[i][Search_Model]) &&
			(GetDistanceBetweenPoints3D(x, y, z, SearchData[i][SearchX], SearchData[i][SearchY], SearchData[i][SearchZ]) < range) )
		{
		    format(tmp, sizeof(tmp), "{ %f, %f, %f, %f, %f, %f, %f }, \r\n",
				SearchData[i][SearchX], SearchData[i][SearchY], SearchData[i][SearchZ],
		        SearchData[i][SearchRX], SearchData[i][SearchRY], SearchData[i][SearchRZ]
		    );
		    fwrite(f, tmp);
		}
	}
	
	fclose(f);

	return 1;
}
Reply


Messages In This Thread
Calculate RZ from X and Y - by m4karow - 11.04.2018, 20:11
Re: Calculate RZ from X and Y - by Mugala - 11.04.2018, 21:27
Re: Calculate RZ from X and Y - by NaS - 12.04.2018, 14:28
Re: Calculate RZ from X and Y - by Joe Staff - 12.04.2018, 14:35
Re: Calculate RZ from X and Y - by NaS - 12.04.2018, 14:50
Re: Calculate RZ from X and Y - by m4karow - 12.04.2018, 15:26
Re: Calculate RZ from X and Y - by NaS - 12.04.2018, 15:57
Re: Calculate RZ from X and Y - by Pottus - 12.04.2018, 17:07
Re: Calculate RZ from X and Y - by m4karow - 12.04.2018, 17:19
Re: Calculate RZ from X and Y - by Pottus - 12.04.2018, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)