how to get new day in samp
#1

hello, i want to get new day in samp, like the veriable is reseting in other day 00:01 so if player is offline and server gets new day the server will reset veriable in mysql, I know how to reset for players veriable but i dont know how to get new day
Reply
#2

explain more please
Reply
#3

when there is new day in server, like it was 04.01 and its chaning time after 00:00 into 04.02 i need to reset veriables for playeres
Reply
#4

Why not just use getdate or gettime so you can calculate the difference of the days in seconds?
Reply
#5

i have this code:
Quote:

new
string[ 64 ],
KadaAtsijunge[ 50 ];
format( string, 64, "SELECT * FROM zaidejai WHERE vardas = '%s' ", zVardas( playerid ) );
mysql_query( string );
mysql_store_result( );
if( mysql_retrieve_row( ) ) mysql_get_field( "AtsijungeP", KadaAtsijunge );
if( strval( KadaAtsijunge ) != strval( GautiDiena( ) ) )
{
zInfo[ playerid ][ praleistas ] = 0;
}

and
Quote:

stock GautiDiena( )
{
/* gauname data ir laika tokiu formatu METAI.MENUO.DIENA, VALANDA:MINUTE */
new
string[ 31 ],
data[ 3 ];
getdate( data[ 0 ], data[ 1 ], data[ 2 ] );
format( string, 31, "%d.%02d.%02d", data[ 0 ], data[ 1 ] ,data[ 2 ] );
return string;
}

and its not working, this code is after player loading
Reply
#6

help please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)