SA-MP Forums Archive
My onlinetimer is getting stucked! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My onlinetimer is getting stucked! (/showthread.php?tid=492372)



My onlinetimer is getting stucked! - TheBosss - 03.02.2014

Hello Guys,

I have an online timer which modifies the worldtime in this form:Hour:minute | Day
Is working fine but after 2 days of uptime its getting stucked at a date..
I have no idea why,maybe if i'll show the code you could help me:
The timer added to OnGameModeInit:
pawn Код:
SetTimer( "onlineTimer", 1000, true );
And the online timer function:
pawn Код:
function onlineTimer( )
{
    new S_TIME[ 6 ], S_DAY[ 256 ], S_STRING[ 256 ];
    getdate( S_TIME[ 0 ], S_TIME[ 1 ], S_TIME[ 2 ] );
    gettime( S_TIME[ 3 ], S_TIME[ 4 ], S_TIME[ 5 ] );

    switch( GetDay( S_TIME[ 2 ], S_TIME[ 1 ], S_TIME[ 0 ] ) )
    {
        case 1: S_DAY = "Luni";
        case 2: S_DAY = "Marti";
        case 3: S_DAY = "Miercuri";
        case 4: S_DAY = "Joi";
        case 5: S_DAY = "Vineri";
        case 6: S_DAY = "Sambata";
        case 7: S_DAY = "Duminica";
    }
    format( S_STRING, sizeof( S_STRING ), "worldtime %02d:%02d | %s", S_TIME[ 3 ], S_TIME[ 4 ], S_DAY );
    SendRconCommand( S_STRING );
}
Sorry,if I couldn't explained it very well!


Re: My onlinetimer is getting stucked! - TheBosss - 03.02.2014

UP!Please,answer


Re: My onlinetimer is getting stucked! - TheBosss - 04.02.2014

Any ideas?