SA-MP Forums Archive
Elevator & Polygon - 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: Elevator & Polygon (/showthread.php?tid=443982)



Elevator & Polygon - Kyle - 14.06.2013

Anyone know the ID of this elevator?

The one I use seems 'metalic':



I want this one:



Also, does anyone know about creating just 1 area to cover the whole of the SAMP tower but create it accurately?

Thanks


Re: Elevator & Polygon - Pottus - 14.06.2013

You could use

pawn Код:
native CreateDynamicPolygon(Float:points[], Float:minz = -FLOAT_INFINITY, Float:maxz = FLOAT_INFINITY, maxpoints = sizeof points, worldid = -1, interiorid = -1, playerid = -1);
Then just have a Z-Height check range.


Re: Elevator & Polygon - Kyle - 14.06.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
You could use

pawn Код:
native CreateDynamicPolygon(Float:points[], Float:minz = -FLOAT_INFINITY, Float:maxz = FLOAT_INFINITY, maxpoints = sizeof points, worldid = -1, interiorid = -1, playerid = -1);
Then just have a Z-Height check range.
How does that work? How does it know accurately if it is outside the building by 1 meter for example? Without plotting the corners I don't see how it would/could work.


Re: Elevator & Polygon - Pottus - 14.06.2013

It's a polygon it can be any shape but needs to be closed and not overlapping the Z-Height is infinite so you need to check if the player is in that range why wouldn't it work ?


Re: Elevator & Polygon - Kyle - 14.06.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
It's a polygon it can be any shape but needs to be closed and not overlapping the Z-Height is infinite so you need to check if the player is in that range why wouldn't it work ?
Edit: My bad... Do I need to put a point on each corner?


Re: Elevator & Polygon - Pottus - 14.06.2013

You'll need as many points to get a clean polygon so if it's a rounded building there might be a lot of points and should only be used when this criteria is met.

Angles at points are less than/greater than 90 degrees
or
Building has more than 4 points

If neither condition is true then almost certainly you would use square/rectangular area and of course don't forget your Z-Range checking!


Re: Elevator & Polygon - Kyle - 14.06.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
You'll need as many points to get a clean polygon so if it's a rounded building there might be a lot of points and should only be used when this criteria is met.

Angles at points are less than/greater than 90 degrees
or
Building has more than 4 points

If neither condition is true then almost certainly you would use square/rectangular area and of course don't forget your Z-Range checking!
Thanks for your help, it is looking pretty hot.

Just trying to find that texture for the lift now