Timer doesn't work properly
#2

I'am suggestion to make a global timer.

pawn Код:
OnGameModeInit() {
    SetTimer("CheckMinute", 60000, true);
    return 1;
}

forward CheckMinute(); public CheckMinute() {
    foreach(new i: Players) { // you can use a loop it's just for more optimisation  

        new sat, minut, sekund, godina, mesec, dan;
    gettime(sat, minut, sekund);
    getdate(godina, mesec, dan);
    new szString[64], ime[MAX_PLAYER_NAME];
    RPIme(playerid, ime);
    PI[playerid][PayDayPoeni]++;
    if(PI[playerid][PayDayPoeni] == 50)
    {
        if(PI[playerid][Banka] < 0){
            format(szString, sizeof(szString), "| {1E90FF}Nova Banka{ffffff} | Stanje na vasem racunu je u minusu $%d, vratite dug kako ne biste bili kaznjeni.",PI[playerid][Banka]);
            SCM(playerid, -1, szString);
        }
    }
        if(PI[playerid][PayDayPoeni] >= 60){
        PayDay(playerid);
        PI[playerid][PayDayPoeni] = 0;
        hDobioPay[playerid] = 0;
        format(szString, sizeof(szString), "%s je dobio platu. Vreme: %d sati, %d min, %d sec",ime,sat,minut,sekund);
        UpisiLog(FAJL_PDDEBUGLOG, szString);
    }
    }
    return 1;
}
Reply


Messages In This Thread
Timer doesn't work properly - by GGRPSkripter - 09.02.2016, 18:47
Re: Timer doesn't work properly - by AlexBlack - 09.02.2016, 18:56
Re: Timer doesn't work properly - by GGRPSkripter - 09.02.2016, 19:04
Re: Timer doesn't work properly - by ikey07 - 09.02.2016, 19:07

Forum Jump:


Users browsing this thread: 1 Guest(s)