Level & Textdraw
#6

Well, from what you've posted, the only way that a player can level-up is by obtaining minutes which is obviously given every minute. So make a repeating timer for 1 minute.

Alright, let's start. First, declare a forward for the call-back.
pawn Код:
forward OneMinute();
Then set the timer
pawn Код:
public OnGameModeInit()
{
    SetTimer("OneMinute", 60000, 1);
    return 1;
}
For an explanation of the code above:
OneMinute would be the call-back as declared above, 60000 is the interval which is 1 minute, and the last parameter as 1 to identify it as repeating.

Next, let's create the actual call-back.
pawn Код:
public OneMinute()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            // Create your own variables which I assume that you already have for each player.
            // That would be the enumeration(enum) on top of your script.
            PlayerStats[i][pMinutes]++; // this is just an example, change it with your actual variable.
        }
    }
    return 1;
}
On the call-back, it would loop through all the players online and would give them 1 point to their minutes variable.
Reply


Messages In This Thread
Level & Textdraw - by 3RoR - 11.04.2012, 18:35
Re: Level & Textdraw - by Skribblez - 11.04.2012, 18:45
Re: Level & Textdraw - by 3RoR - 11.04.2012, 18:50
Re: Level & Textdraw - by Skribblez - 11.04.2012, 18:58
Re: Level & Textdraw - by 3RoR - 11.04.2012, 19:49
Re: Level & Textdraw - by Skribblez - 11.04.2012, 20:36
Re: Level & Textdraw - by 3RoR - 11.04.2012, 20:45

Forum Jump:


Users browsing this thread: 1 Guest(s)