Professional timed messages?
#1

Hello,

I know how to make these, but is there any way to make the messages professional? Because, as long as the server runs, as long as the timed messages will spam the server, they are more into random messages. So, I want something like, to check if the player is paused or tabbing, not to send the messages and like send these messages every 30 minutes?
Reply
#2

If you want to check if the player is paused, just do that.(never tested that, but it should work i guess.)

pawn Код:
new timecheck[MAX_PLAYERS],works[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
    if(!GetPlayerAnimationIndex(playerid)) timecheck[playerid] = gettime() + 60*30;  // 30 minutes...
}
public OnPlayerConnect(playerid)
{
   works[playerid] = SetTimerEx("checkup",1000,true,"i",playerid);
}
forward checkup(playerid);
public checkup(playerid)
{
   for(playerid = 0; playerid != MAX_PLAYERS; ++ playerid)
   {
      if(timecheck[playerid] < gettime()) {
            // functions here.
      }
   }
}

// and put that on onplayerdisconnect
KillTimer(works[playerid]);
Reply
#3

Nice, so the functions goes for uh the messages?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)