30.01.2007, 23:07
Added OnPlayerConnect for Flame^'s Snippet.
// The function
// ISPIA Function
pawn Code:
SetTimer("AreaCheck", 1000, 1);
pawn Code:
AreaCheck()
{
for(new i=0; i<MAX_PLAYERS; i++ ) {
if(IsPlayerConnected(i))
{
if(IsPlayerInArea(i, minx, maxx, miny, maxy) && !IsPlayerAdmin(i)) // CHECK: If the player is a admin, if the player is in the area
{ // He's not.
SendClientMessage(i, YOURCOLOR, "You are not allowed to enter the ADMIN area.");
/* Do with him whatever you want */
}
}
}
}
pawn Code:
IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}