timer for dynamic cp
#4

run 2/3 second timer, no other option
e.g
pawn Код:
//top of GM/FS
new UpdateTimer;
new InPos[MAX_PLAYERS];
//At gememodeint or filterscriptint
UpdateTimer = SetTimer("OnTimerUpdate", 3000, true);

//the callback
forward OnTimerUpdate();
public OnTimerUpdate{
for(new playerid = 0; playerid  < MAX_PLAYERS; playerid ++)
{
     if(IsPlayerInRangeOfPoint(playerid ,distance,x,y,z) && InPos[playerid]==0)
     {
          InPos[playerid]=1;
          //do what ever if the player is in the x,y,z cords
     }else{
          InPos[playerid]=0;
     }
}
return 1;
}
the variables are so there is no loop when checking the timer
Reply


Messages In This Thread
timer for dynamic cp - by PaulDinam - 30.11.2012, 12:37
Re: timer for dynamic cp - by DaRk_RaiN - 30.11.2012, 12:40
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 13:04
Re: timer for dynamic cp - by park4bmx - 30.11.2012, 13:11
Re: timer for dynamic cp - by DaRk_RaiN - 30.11.2012, 13:28
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 14:38
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 18:31
Re: timer for dynamic cp - by GWMPT - 30.11.2012, 18:38
Re: timer for dynamic cp - by B-Matt - 30.11.2012, 18:51
Re: timer for dynamic cp - by PaulDinam - 30.11.2012, 19:37

Forum Jump:


Users browsing this thread: 4 Guest(s)