lil question
#1

how can i make levels with time for example, 1hour game play = level 1, 5 hour game play = level 2, blah blah?
Reply
#2

In short: Create a timer for every player in OnPlayerConnect that counts how long the player was online at all (You also want to save that time i guess). Every time the timer function is called, check if the onlinetime of the player is bigger than your level limit. If it is, level the player up as you like (Messages, scores, whatever)
Reply
#3

pawn Код:
new Level[MAX_PLAYERS];
new Hours[MAX_PLAYERS];
forward H(playerid)


public OnPlayerConnect(playerid)
{
    SetTimerEx("H",60*60*1000,true,"i",playerid);
    return 1;
}

public H(playerid)
{
    Hours[playerid]++;
    if(Hours[playerid] == 1)
    {
         SendClientMessage(playerid,COLOR,"You're now lvl 1!");
         Level[playerid]= 1;
     }
     else if(Hours[playerid] == 5)
     {
         SendClientMessage(playerid,COLOR,"You're now lvl 2!");
         Level[playerid]=2;
      }
      return 1;
}
Not tested
Reply
#4

wat is 60*60*1000?? isnt it suppose to be like 600000,
Reply
#5

Sorry for double post, how can i add minutes?
Reply
#6

lil help please?
Reply
#7

Quote:
Originally Posted by tanush
Посмотреть сообщение
wat is 60*60*1000?? isnt it suppose to be like 600000,
Real Life that would be equal to 60x60x100 which would be equal to 3600000.
Reply
#8

Tee can you help me with minutes pls
Reply
#9

What help do you want?
Reply
#10

pawn Код:
New Minutes[MAX_PLAYERS];
New Hours[MAX_PLAYERS];
forward OnlineTimer(playerid);

SetTimerEx("OnlineTimer",60000,1,"i",playerid);

public OnlineTimer(playerid)
{
    Minutes[playerid]++;
    if(Minutes[playerid] == 60)
    {
        Hours[playerid]++;
        Minutes[playerid] = 0;
    }
    return 1;
}
also remember to stop the timer when the player goes offline
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)