14.06.2010, 06:59
Try this:
You also need to set a timer to use this though..
Код:
#include <a_samp> #define green 0x33AA33AA #define red 0xAA3333AA new IsIn[MAX_PLAYERS], IsOut[MAX_PLAYERS]; forward Areacheck(); public Areacheck() { for(new i=0; i < MAX_PLAYERS; i++) { if (IsPlayerInArea(i, 2858,2342,-2319,-2742) && IsIn[i] == 0) { IsIn[i] = 1; IsOut[i] = 1; SendClientMessage(i,green, "Welcome to the Dm area!"); } if (!IsPlayerInArea(i, 2858,2342,-2319,-2742) && IsOut[i] == 1) { IsIn[i] = 0; IsOut[i] = 0; SendClientMessage(i,red, "You left the Dm area!"); } } return 1; } // IsPlayerInArea Function. 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; }