03.02.2014, 15:59
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:
And the online timer function:
Sorry,if I couldn't explained it very well!
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 );
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 );
}