Calcolate Area
#1

How i can make the area with 2 point?

point1 = X1, Y1
point2 = X2, Y2

What is the formule?



point1___________
|
|
|
|___________point2
Reply
#2

Idk what do you mean, You can use sa-mp range callbacks to check if a player is within that radius
Reply
#3

Use this to get the distances:
pawn Код:
stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
{
    return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ) );
}
And then use floatmul(float1, float2) to multiply the 2 distances and get the area.

Learn to use the search function of these forums or at least ******.
Reply
#4

https://sampwiki.blast.hk/wiki/Areacheck

position 1: X: 20.0 Y: 100.0
position 2: X: 35.0 Y: 250.0

looks like
Код:
                     _________________ X: 35.0 Y: 250.0
                     |                |
                     |    This is     |
                     |  the area that |
                     |    you want    |
                     |   to define!   |
                     |________________|
      X: 20.0 Y: 100.0
Position 1 is the minimum- and position 2 the maximum values.

A Area check for this Area would look like
Код:
IsPlayerInArea(playerid,20.0,35.0,100.0,250.0);
it's
Код:
IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy);
Reply
#5

Thanks CutX! I can make also GangZoneCreate right?
Float:minx, Float:maxx, Float:miny, Float:maxy

EDIT:
Yes, thanks!
https://sampwiki.blast.hk/wiki/GangZoneCreate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)