How do I add more areas with CreateDynamicPolygon ?
#1

How do I add more areas with CreateDynamicPolygon ?
Reply
#2

pawn Code:
new  PolygoArea[2];

PolygoArea[0] = CreateDynamicPolygon(.....);
PolygoArea[1] = CreateDynamicPolygon(.....);
Reply
#3

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)
Reply
#4

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.
Reply
#5

how i will CreateDynamicPolygon ??
Reply
#6

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

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.
Reply
#8

fixed
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)