2023-10-23, 08:53 PM
(2023-10-23, 05:44 AM)denNorske Wrote: In order to get the center coordinates, you need to know what you already have. You have the two edges in both X and Y direction (Min and Max values).
The center will just be the following:
PHP Code:new Float:centerx = (minx + maxx) / 2.0;
new Float:centery = (miny + maxy) / 2.0;
That will result as
PHP Code:centerx = 1343.679
centery = 2138.5615
Worked perfectly! Thanks!
PHP Code:
stock GetZoneCenterPos(Float:minx,Float:miny,Float:maxx,Float:maxy,&Float:centerx,&Float:centery)
{
centerx = ((minx + maxx) / 2);
centery = ((miny + maxy) / 2);
}