OnlineTime counter Problem
#1

pawn Код:
forward OnlineTime(playerid);
public OnlineTime(playerid)
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            PlayerInfo[i][Minutes]++;
            if (PlayerInfo[i][Minutes] >= 60)
            {
                PlayerInfo[i][Minutes] = 0;
                PlayerInfo[i][Hours]++;
                new string[128];
                new RandomPay = random(50000 - 10000) + 10000;
                GivePlayerMoney( playerid, RandomPay );
                format(string, sizeof(string), "   [PAYDAY]  You Have Got Paycheck Of => $%i", RandomPay);
                SendClientMessage(i, COLOR_WHITE, string);
            }
        }
    }
    return 1;
}
^ This msg is set to show up every 60 minutes of player's in-game time.
Here is the timer for this.
pawn Код:
OnlineTime = SetTimerEx("OnlineTime", 60000, true, "i", playerid);
But for some reason it shows up every 15-20 minutes. Also the players onlinetime increase 1 minute in like 30 seconds. -_-
Anyone wanna help out? I +Rape for helping me :>
Reply
#2

Alright, you need to do a player variables instead of this OnlineTime use
pawn Код:
OnlineTime[playerid]
and it should work as charm.

do not forget to add
pawn Код:
new OnlineTime[MAX_PLAYERS];
at the top of your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)