SA-MP Forums Archive
How do I add more areas with CreateDynamicPolygon ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do I add more areas with CreateDynamicPolygon ? (/showthread.php?tid=665722)



How do I add more areas with CreateDynamicPolygon ? - Benzi - 13.04.2019

How do I add more areas with CreateDynamicPolygon ?


Re: How do I add more areas with CreateDynamicPolygon ? - SiaReyes - 14.04.2019

pawn Code:
new  PolygoArea[2];

PolygoArea[0] = CreateDynamicPolygon(.....);
PolygoArea[1] = CreateDynamicPolygon(.....);



Re: How do I add more areas with CreateDynamicPolygon ? - Benzi - 14.04.2019

Code:
new  PolygoArea[2];

PolygoArea[0] = CreateDynamicPolygon(-1039.82, 490.40, -1002.52, 452.99, -1056.22, 399.70, -1092.80, 437.74);
PolygoArea[1] = CreateDynamicPolygon(1922.69, -2512.92, 2050.15, -2512.90, 2049.84, -2574.33, 1922.98, -2574.36);
Code:
Untitled4.pwn(122) : error 010: invalid function or declaration
Untitled4.pwn(130) : error 035: argument type mismatch (argument 2)



Re: How do I add more areas with CreateDynamicPolygon ? - T0Play - 14.04.2019

Quote:
Originally Posted by Benzi
View Post
Code:
new  PolygoArea[2];

PolygoArea[0] = CreateDynamicPolygon(-1039.82, 490.40, -1002.52, 452.99, -1056.22, 399.70, -1092.80, 437.74);
PolygoArea[1] = CreateDynamicPolygon(1922.69, -2512.92, 2050.15, -2512.90, 2049.84, -2574.33, 1922.98, -2574.36);
Code:
Untitled4.pwn(122) : error 010: invalid function or declaration
Untitled4.pwn(130) : error 035: argument type mismatch (argument 2)
the coordinates are not like that.


Re: How do I add more areas with CreateDynamicPolygon ? - Benzi - 14.04.2019

how i will CreateDynamicPolygon ??


Re: How do I add more areas with CreateDynamicPolygon ? - SyS - 14.04.2019

https://github.com/samp-incognito/sa...Natives-(Areas)


Re: How do I add more areas with CreateDynamicPolygon ? - NaS - 14.04.2019

You need an array of coordinates (X and Y coord pairs), and declare it like this:

Code:
new Float:polygon_coords[] =
{
	408.2250, 2173.6580, // Point 1
	346.6827, 1643.3701, // Point 2
	-122.9496, 1689.5978, // Point 3
	408.2250, 2173.6580 // Point 1 to close it
};
As you might have noticed, the very last pair must be equal to the first, so that the polygon closes. Then pass this array to CreateDynamicPolygon (to the "points" argument). Minimum and maximum Z can be adjusted in the function.


Re: How do I add more areas with CreateDynamicPolygon ? - Benzi - 15.04.2019

fixed