Timer Help
#1

Hello,

Im not sure on how timers are done. I need a timer for a server tutorial, let me explain:
Players must read the tutorial, once finished reading that section they must use a command such as "/next" to move onto the next section of the tutorial. But I need a timer to make sure they read it for atleast a certain amount of time. So they can't simply spam /next and skip the tutorial.

How can I do this?
Reply
#2

Код:
new bool:next[MAX_PLAYERS];
forward next(playerid);
CMD:next(playerid,params[]) // command
{
    if(next[playerid] == false) // check if player allowed to use this command
    {
        next[playerid] = true; // set array next to true,means he used the command
        SetTimer("next", x,0); // change x with the time you want the player to wait until he can use /next again 
    }else{
       return 0; // if player isn't allowed to use this command then it will not do anything.
    }
    return 1;
}
public next(playerid)
{
    next[playerid] = false; // player allowed to use the command
}
Reply
#3

I knew there would be something for what you said ******, cheers, I will use that I guess.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)