21.01.2014, 18:47
So it would go a little bit like this:
pawn Код:
#define GangZone1 0
pawn Код:
stock IsInArea(playerid, area)
{
new Float:p[3],Float:ap[4];
GetPlayerPos(playerid, p[0], p[1], p[2]);
switch(area)
{
case 0: ap[0] = x, ap[1] = y, ap[2] = x, ap[3] = y;
}
if(pX <= max_x && pX >= min_x && pY <= max_y && pY >= min_y) return 1;//if players coords are within the area, return 1 for true
return 0;
}
pawn Код:
CMD:claimturf(playerid)
{
if(IsInArea(playerid,0))
{
GangZoneFlashForAll(GangZone1, COLOR_WHITE);
SetTimerEx("GangZoneTimer", 300000, false, "i", playerid);
}
else if // So on..
return 1;
}