22.05.2014, 14:06
There is no need for a timer because in samp exists areas where you can use a callback "OnPlayerLeaveDynamicArea" (streamer is required)
Example:

EDIT: to pick the cordinates you save the cordinates of the diagonal of your rectangle or you use

In my case the saved cordinates are
first point - x = 0, y = 0 (start of the diagonal)
second point - x = 50, y = 50 (end of the diagonal)
SRY for bad english
Example:
Code:
new areaID, zona;
public OnGameModeInit()
{
areaID = CreateDynamicRectangle(0.0, 0.0, 50.0, 50.0);
zona = GangZoneCreate(0.0, 0.0, 50.0, 50.0);
GangZoneShowForAll(zona, G_RED);
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid) {
if(areaid == areaID) {
SendClientMessage(playerid, -1, "You have leaved that area!");
}
return 1;
}
public OnPlayerEnterDynamicArea(playerid, areaid) {
if(areaid == areaID) {
SendClientMessage(playerid, -1, "You have entered that area!");
}
return 1;
}

EDIT: to pick the cordinates you save the cordinates of the diagonal of your rectangle or you use
Code:
CreateDynamicCircle(x, y, size)

In my case the saved cordinates are
first point - x = 0, y = 0 (start of the diagonal)
second point - x = 50, y = 50 (end of the diagonal)
SRY for bad english

