12.09.2010, 19:40
I've got this function:
And i tryed to take the coordinates for the red square
In the upper left corner, i typed /save and i got:
[b]-15.4505, -6.0218[/[b]
x_min = -15.4505
y_max = -6.0218
In the down right corner, i typed /save and i got:
30.1200,5.7569
x_max = 30.1200
y_min = 5.7569
and at OnPlayerUpdate, i've added:
And i don't get any client message ...
pawn Код:
public IsPlayerInArea(playerid, Float:maxx, Float:minx, Float:maxy, Float:miny)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy)
return 1;
return 0;
}
In the upper left corner, i typed /save and i got:
[b]-15.4505, -6.0218[/[b]
x_min = -15.4505
y_max = -6.0218
In the down right corner, i typed /save and i got:
30.1200,5.7569
x_max = 30.1200
y_min = 5.7569
and at OnPlayerUpdate, i've added:
pawn Код:
if(IsPlayerInArea(playerid,30.1200, -15.4505, -6.0218, 5.7569))
printf("%d is in area",playerid);