15.09.2012, 08:07
This should work:
NOTE: This WILL spam the player with messages once they spawn, it would be better to assign it to a command rather than a timer.
pawn Код:
public OnPlayerSpawn(playerid)
{
SetTimerEx("CheckArea", 1000, true, "i", playerid);
return 1;
}
forward CheckArea(playerid);
public CheckArea(playerid)
{
if(IsPlayerInArea(playerid,2424,-1758,2640,-1620))
{
SendClientMessage(playerid,COLOR_GREEN,"Your on Property of GS Watch Your back");
}
else
{
SendClientMessage(playerid, COLOR_RED,"You're not on Property of GS.");
}
return 1;
}
stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(minx < x < maxx && miny < y < maxy) return true;
return false;
}