03.07.2011, 20:25
If you can't bother downloading the plugin use this code.
pawn Код:
public OnPlayerUpdate(playerid)
{
if (IsPlayerInArea(playerid, areaminx, areamaxx, areaminy, areamaxy)) // change the parameters
{
if (IsPlayerAdmin(playerid)) {
SendClientMessage(playerid, -1, "Welcome to the admin area");
}else{
SendClientMessage(playerid, -1, "You are not an admin to enter the admin area!"),
SetPlayerHealth(playerid, -1);
}
}
}
stock 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;
}