12.12.2010, 10:21
pawn Код:
public OnPlayerSpawn(...)
{
SetTimer("AdminCheck",5000,1);
return 1;
}
forward AdminCheck(playerid);
public AdminCheck(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdminLevel] >= 1)
{
new Float:x,Float:y,Float:z;
new Float:pz,Float:py,Float:pz;
GetPlayerPos(i, x, y, z);
GetPlayerPos(playerid, px, py, pz);
if(!IsPlayerInRangeOfPoint(playerid,x,y,z))
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_RED,"You have freezed because you are not near admin");
}
}
}
return 1;
}

EDIT:Changed to freeze,old one would kill the player

