23.02.2010, 08:51
Code:
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1; return 0; }
Then,
pawn Code:
forward InArea(playerid); // on top
SetTimer("AreaCheck", 1000, true); // at 'onplayerspawn'
public InArea
{
if(IsPlayerInArea(playerid, max_X, min_X, max_Y, min_Y) // add your own min_X, max_x, min_Y, and max_Y
{
SendClientMessage(playerid,0xFF0000AA,"You are now in range.");
}
return 1;
}