Online Time System Issue
#1

Well, I scripted an online time script yesterday, while I was testing in the server with 2 players, different time connected...

Example of situation:
First, I joined at 7:30 PM, so the timer started to count. And another player joined at 8:00 PM.

But after 1 hour, which is 8:30PM, I received an hour bonus, but player 2 received it too. And after 30 minutes, 9:00 PM, I received another again.. So how to fix it? Here's the code!

OnPlayerConnect:
pawn Код:
public OnPlayerConnect(playerid)
{
    //Lots of code...
    SetTimer("OneHourBonus", 1000*60*60, 1);
    return 1;
}
forward/public OneHourBonus:
pawn Код:
forward OneHourBonus();
public OneHourBonus()
{
    for (new i, slots = GetMaxPlayers(); i < slots; i ++)
    {
        GivePlayerMoney(i, 5000);
        SetPlayerScore(i,GetPlayerScore(i)+5);
        SendClientMessage(i, -1, "Thanks for playing on our server for 1 hour! As a bonus, $5000 and 5 scores have been given you.");
        pInfo[i][Hours]++;
    }

    return 1;
}
How to fix it? :/
Reply


Messages In This Thread
Online Time System Issue - by LeeXian99 - 23.04.2013, 12:27
Re: Online Time System Issue - by fordawinzz - 23.04.2013, 12:36
Re: Online Time System Issue - by LeeXian99 - 23.04.2013, 12:39
AW: Online Time System Issue - by HurtLocker - 23.04.2013, 12:50
Re: Online Time System Issue - by zxc1 - 23.04.2013, 12:51
Re: Online Time System Issue - by LeeXian99 - 23.04.2013, 13:52

Forum Jump:


Users browsing this thread: 2 Guest(s)