Setting A Timer On Player Disconnect
#3

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
pawn Код:
new
    TruckMinutes[MAX_PLAYERS];

forward OneMinute();
public OneMinute()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(i != INVALID_PLAYER_ID && TruckMinutes[i] > 0)
        {
            TruckMinutes[playerid]--;
        }
    }
    return 1;
}

public OnGameModeInit()
{
    SetTimer("OneMinute", 60000, true);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TruckMinutes[playerid] = 0;
    return 1;
}

In the command, you would set TruckMinutes to however big the reload time is in minutes.

Every minute, for every player that is connected, their variable will reduce by one.

You would have to save the variable, and load it on connect.
Thanks man, I'll use this for my command if I can't get the time function to work instead. Rep for you.
Reply


Messages In This Thread
Setting A Timer On Player Disconnect - by WinterAce - 12.07.2012, 01:55
Re: Setting A Timer On Player Disconnect - by ReneG - 12.07.2012, 03:23
Re: Setting A Timer On Player Disconnect - by WinterAce - 12.07.2012, 11:49
Re: Setting A Timer On Player Disconnect - by WinterAce - 12.07.2012, 11:51

Forum Jump:


Users browsing this thread: 2 Guest(s)