IsPlayerInArea ?!
#1

I want to check if a player is in a specific Area....
With browsing the wiki,i found
Код:
GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
      if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37)
Now i want to search , if a Player is in an area, but the area is defined with variables.

So the variables are declared ...:
Код:
  new Float:X,Float:Y,Float:Z;
	GetPlayerPos(killerid,X,Y,Z);
	oldxx = oldx - distance;
	oldx2 = oldx + distance;
	oldyy = oldy + distance;
	oldy2 = oldy - distance;
	print("Distanz");
	printf("%i",distance); //Distance
	print("oldxx");
	printf("%f",oldxx); //down
	print("oldx2");
	printf("%f",oldx2); //top
	print("oldyy");
	printf("%f",oldyy); //left
	print("oldy2");
	printf("%f",oldy2); //right
	print("X");
  printf("%f",X); //actual x position
  print("Y");
  printf("%f",Y); //actual y position
  
	if(X >= oldxx && X <= oldx2 && Y >= oldyy && Y <= oldy2)
You can see the last condition?
Heres the log:
Quote:

[12:06:27] Incomming connection: 192.168.2.100:2028
[12:06:27] [join] Trooper[Y] has joined the server (0:192.168.2.100)
[12:06:49] Distanz
[12:06:49] 500
[12:06:49] oldxx
[12:06:49] -615.161743
[12:06:49] oldx2
[12:06:49] 384.838256
[12:06:49] oldyy
[12:06:49] 2529.385253
[12:06:49] oldy2
[12:06:49] 1529.385253
[12:06:49] X
[12:06:49] 317.487945
[12:06:49] Y
[12:06:49] 2526.640625
[12:06:54] [part] Trooper[Y] has left the server (0:1)

And can you know tell my,why nothing had happened ?
From my Point of view, the condition have to be right !
I cant understand why the condition isn`t true....

Hope on your answer,
Trooper
Reply
#2

It just doesn't get called, that's why it doesn't print it.
Reply
#3

Quote:

It just doesn't get called,

How do you exactly man it?
Can u give an example ?

I call it with
Код:
SetTimerEx("checkregion",10000,0,"iffi",killerid,X-500,Y-500,500);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)