IsPlayerInArea, doesn't work... weird
#1

Код:
print("Zone Check Spawned");
		if( InZone[playerid] == INVALID_GANG_ZONE )
		{
		  print("Invalid InZone");

			new Float:pX, Float:pY, Float:pZ;
			GetPlayerPos(playerid, pX, pY, pZ);

			for(new i=0; i < MAX_ZONES; i++)
			{
			  if( strlen(pZone[i][Name]) != 0 )
			  {
				  printf("%i i | %0.f p| %0.f p| %0.f p| %0.0f z| %0.f z| %0.f z| %0.f z|", i, pX, pY, pZ, pZone[i][mnX], pZone[i][mnY], pZone[i][mxX], pZone[i][mxY] );
				  if( pX >= pZone[i][mnX] && pY >= pZone[i][mnY] && pX <= pZone[i][mxX] && pY <= pZone[i][mxY])
					{
					  printf("%s Name %i ID [Of Enter Zone] InZone: %i", pZone[i][Name], i, InZone[playerid]);
						InZone[playerid] = i;
						OnPlayerEnterZone(playerid, i);
						break;
					}
				}
			}
		}
PS: i even tryed with IsPlayerInArea, didn't work... i tryed manually by checking player's coords and area's coords. The area Coords are the corect ones.

This prints:

Quote:
Originally Posted by server log
[11:08:25] Zone Check Spawned
[11:08:25] Invalid InZone
[11:08:25] 0 i | 270 p| 2894 p| 10 p| -1319 z| 2755 z| -1669 z| 2464 z|
[11:08:25] 1 i | 270 p| 2894 p| 10 p| 478 z| 2592 z| 233 z| 2370 z|
[11:08:25] 2 i | 270 p| 2894 p| 10 p| 291 z| 1483 z| 93 z| 1307 z|
[11:08:25] 3 i | 270 p| 2894 p| 10 p| 291 z| 1950 z| 93 z| 1775 z|
[11:08:25] 4 i | 270 p| 2894 p| 10 p| -233 z| 1611 z| -408 z| 1459 z|
[11:08:25] 5 i | 270 p| 2894 p| 10 p| -712 z| 1634 z| -887 z| 1471 z|
[11:08:25] 6 i | 270 p| 2894 p| 10 p| -618 z| 1004 z| -724 z| 875 z|
[11:08:25] 7 i | 270 p| 2894 p| 10 p| -315 z| 2265 z| -443 z| 2160 z|
[11:08:25] 8 i | 270 p| 2894 p| 10 p| -595 z| 1985 z| -829 z| 1810 z|
[11:08:25] 9 i | 270 p| 2894 p| 10 p| -1156 z| 1845 z| -1226 z| 1763 z|
[11:08:25] 10 i | 270 p| 2894 p| 10 p| 1109 z| 2954 z| 1015 z| 2861 z|
[11:08:25] 11 i | 270 p| 2894 p| 10 p| -1319 z| 1518 z| -1459 z| 1459 z|
[11:08:25] 12 i | 270 p| 2894 p| 10 p| -490 z| 2627 z| -607 z| 2522 z|
[11:08:25] 13 i | 270 p| 2894 p| 10 p| -502 z| 934 z| -607 z| 770 z|
[11:08:25] 14 i | 270 p| 2894 p| 10 p| 303 z| 2966 z| 210 z| 2861 z|
Any idea?
Reply
#2

Quote:
Originally Posted by [N
Dakota ]
Not a clue. sorry.
Thanks for the input.

y coordinate 2894 is outside of all of those zones
mis read only in 2 of those zones

Edit
All of your MINIMUM Ys are greater than the MAXIMUM Ys
Reply
#3

zomg so i made them the opposite way XD

OMG im so blind.

Thnx alot Joe
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)