• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Center of GangZoneCreate()
#3
(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);

  Reply


Messages In This Thread
Center of GangZoneCreate() - by JR_Junior - 2023-10-22, 05:56 PM
RE: Center of GangZoneCreate() - by denNorske - 2023-10-23, 05:44 AM
RE: Center of GangZoneCreate() - by JR_Junior - 2023-10-23, 08:53 PM
RE: Center of GangZoneCreate() - by denNorske - 2023-10-26, 09:29 AM

Forum Jump: