player in area.. but not a square area check.?.? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: player in area.. but not a square area check.?.? (
/showthread.php?tid=65018)
player in area.. but not a square area check.?.? -
Outbreak - 08.02.2009
Is it possible to do a check on an area with a circle radius instead of the max and min x and y co-ords?
so for example check a circluar area with a radius of 100..
is it at all possible?
Re: player in area.. but not a square area check.?.? -
Ghett0 - 09.02.2009
Nope.
Re: player in area.. but not a square area check.?.? -
x-cutter - 09.02.2009
Use PlayerToPoint. I think it\'s in a circle radius
Re: player in area.. but not a square area check.?.? -
Outbreak - 09.02.2009
Thanks X_Cutterz, thats exactly what i was after... thanks
Re: player in area.. but not a square area check.?.? -
yom - 09.02.2009
pawn Code:
Float:Distance3D(Float:PointA[], Float:PointB[], bool:sqrt = true)
{
new Float:Dist[3];
Dist[0] = PointA[0] - PointB[0];
Dist[0] *= Dist[0];
Dist[1] = PointA[1] - PointB[1];
Dist[1] *= Dist[1];
Dist[2] = PointA[2] - PointB[2];
Dist[2] *= Dist[2];
Dist[0] += Dist[1] + Dist[2];
return sqrt ? floatsqroot(Dist[0]) : Dist[0];
}
pawn Code:
new Float:PlayerPos[3];
GetPlayerPos(playerid, PlayerPos[0], PlayerPos[1], PlayerPos[2]);
if (Distance3D(PlayerPos, Float:{ X, Y, Z }) < 100.0) //he is less than 100 meters to the point {X, Y, Z}
Re: player in area.. but not a square area check.?.? -
Outbreak - 10.02.2009
Thanks 0rb for the reply, the PlayerToPoint was what i was looking for, its working as i wanted it to.
The info you posted i will keep in mind also, i think i might need it for some small DM areas im making... Thanks
Re: player in area.. but not a square area check.?.? -
Mikep - 10.02.2009
Theres IsPlayerInCircle..