Is there a way to stop gettime();
#1

I'm currently in the way to create a command called "checkafk", which checks for AFK players (here's what I've done now)

pawn Код:
/*As Local*/
new AFKTime[MAX_PLAYERS];


/*Command and stuff*/
public OnPlayerPause(playerid)
{
        //scripts here
    AFK{ playerid } = true;
        AFKTime[playerid] = gettime();
    return 1;
}

public OnPlayerResume(playerid, time)
{
        //scripts here
        //stopping the GETTIME Function
    return 1;
}

CMD:checkafk(playerid,params[] ){
    new count = 0;
    new string[128];
    new names[MAX_PLAYER_NAME];
    GetPlayerName(playerid, names, sizeof(names));
    SendClientMessage(playerid, COLOR_ORANGE,"* AFK(paused) players;");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if( AFK{ i } )
            {
                new name[MAX_PLAYER_NAME];
                GetPlayerName(i, name, sizeof(name));
                format(string, sizeof(string), "* %s[%d]", name, i);
                SendClientMessage(playerid, COLOR_YELLOW, string);
                count++;
            }
        }
    }
    if(count == 0)
    {
        SendClientMessage(playerid, COLOR_ORANGE,"* Nobody is AFK(paused)!");
    }
    return 1;
}
But, how can i stop the "gettime" function, when he comes back?
Reply


Messages In This Thread
Is there a way to stop gettime(); - by Kyance - 23.02.2014, 13:16
Re: Is there a way to stop gettime(); - by MP2 - 24.02.2014, 07:55
Re: Is there a way to stop gettime(); - by Kyance - 24.02.2014, 08:05
Re: Is there a way to stop gettime(); - by LocMax - 24.02.2014, 08:27

Forum Jump:


Users browsing this thread: 2 Guest(s)