Timer doesn't work
#1

Hey there, I have a paycheck system scripted on my game-mode and just like any other role-play scripts, it's set to every hour. It's just really weird that sometimes it works fine and sometimes it doesn't.

Here's what I currently have:

pawn Код:
forward OneSecond();
public OneSecond()
{
    new hour, minute, second;
    gettime(hour, minute, second);
    new string[128];

    if(minute >= 59 && second >= 59)
    {
        SetWorldTime(hour+1);
        format(string, sizeof(string), "The time now is %d:00", hour+1);
        SendClientMessageToAll(0xFFFFFFFF, string);
    }
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(minute >= 59 && second >= 59)
        {
            // Give paycheck here
        }
    }
    return 1;
}

public OnGameModeInit()
{
    SetTimer("OneSecond", 1000, 1);
    return 1;
}
If someone could enlighten me, please do. Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)