Calcolate Area - 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: Calcolate Area (
/showthread.php?tid=454264)
Calcolate Area -
usersamp - 28.07.2013
How i can make the area with 2 point?
point1 = X1, Y1
point2 = X2, Y2
What is the formule?
point1___________
|
|
|
|___________point2
Re: Calcolate Area -
Spooky - 28.07.2013
Idk what do you mean, You can use sa-mp range callbacks to check if a player is within that radius
Re: Calcolate Area -
MellowHammer - 28.07.2013
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 ******.
AW: Calcolate Area -
CutX - 28.07.2013
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);
Re: Calcolate Area -
usersamp - 28.07.2013
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