30.01.2007, 13:20
Admin Area
pawn Code:
// Set the timer triggering the function which checks if players are in the 'admin' area
SetTimer("AreaCheck", 1000, 1);
// The function
AreaCheck()
{
for(new i=0; i<MAX_PLAYERS; i++ ) {
if(IsPlayerConnected(i) && 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 */
}
}
}
// ISPIA Function
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;
}