#include #if defined _dcallbacks_included #endinput #endif #define _dcallbacks_included #pragma library dcallbacks // Update the following line to make more areachecks possible. #define MAX_AREAS_TO_CHECK 10 forward TIMER_PlayerArea(); // add this to make the timer accessable new Float:AREACHECK_Coords[MAX_AREAS_TO_CHECK][4]; new AREACHECK_Player[MAX_AREAS_TO_CHECK]; new AREACHECK_Count=0; /* * Return the AreaId, starts with 1 not 0. */ stock AddAreaCheck(Float:x_min,Float:x_max,Float:y_min,Float:y_max) { AREACHECK_Coords[AREACHECK_Count][0]=x_min; AREACHECK_Coords[AREACHECK_Count][1]=x_max; AREACHECK_Coords[AREACHECK_Count][2]=y_min; AREACHECK_Coords[AREACHECK_Count][3]=y_max; AREACHECK_Count++; return (AREACHECK_Count); } public TIMER_PlayerArea() { new i,z; new Float:x,Float:y,Float:zcoord; for (i=0;ix) && (AREACHECK_Coords[z][2]y) ) { if (z!=AREACHECK_Player[i]-1) { // Is new in this area AREACHECK_Player[i]=z+1; OnPlayerEnterArea(i,z+1); } else { } } else { if (z==AREACHECK_Player[i]-1) { // Player was in this Area OnPlayerLeaveArea(i,z+1); AREACHECK_Player[i]=0; } } } } } #include #include #include