Help with timers
#4

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;
}
Didn't test it yet,but i guess it's working

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


Messages In This Thread
Help with timers - by [JnA]DukeNukem - 12.12.2010, 08:11
Re: Help with timers - by Alex_Valde - 12.12.2010, 09:03
Re: Help with timers - by [JnA]DukeNukem - 12.12.2010, 10:13
Re: Help with timers - by SkizzoTrick - 12.12.2010, 10:21
Re: Help with timers - by [JnA]DukeNukem - 12.12.2010, 10:56
Re: Help with timers - by Marcel - 12.12.2010, 11:01
Re: Help with timers - by [JnA]DukeNukem - 12.12.2010, 13:55

Forum Jump:


Users browsing this thread: 1 Guest(s)