if(BanInfo[playerid][BanYear] >= year && BanInfo[playerid][BanMonth] >= month && BanInfo[playerid][BanDay] >= day && BanInfo[playerid][BanHour] >= hour && BanInfo[playerid][BanMinute] >= minute && BanInfo[playerid][BanSecond] >= second)
public TempBanCheck(playerid) { new string2[64]; new playername2[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername2, sizeof(playername2)); format(string2, sizeof(string2), "bans/%s.ini", playername2); new year, month, day , hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); new File: UserFile = fopen(string2, io_read); if ( UserFile ) { new key[ 256 ] , val[ 256 ]; new Data[ 256 ]; while(fread(UserFile,Data,sizeof(Data))) { key = ini_GetKey( Data ); if( strcmp( key , "BanYear" , true ) == 0 ) { val = ini_GetValue( Data ); BanInfo[playerid][BanYear] = strval( val ); } if( strcmp( key , "BanMonth" , true ) == 0 ) { val = ini_GetValue( Data ); BanInfo[playerid][BanMonth] = strval( val ); } if( strcmp( key , "BanDay" , true ) == 0 ) { val = ini_GetValue( Data ); BanInfo[playerid][BanDay] = strval( val ); } if( strcmp( key , "BanHour" , true ) == 0 ) { val = ini_GetValue( Data ); BanInfo[playerid][BanHour] = strval( val ); } if( strcmp( key , "BanMinute" , true ) == 0 ) { val = ini_GetValue( Data ); BanInfo[playerid][BanMinute] = strval( val ); } if( strcmp( key , "BanSecond" , true ) == 0 ) { val = ini_GetValue( Data ); BanInfo[playerid][BanSecond] = strval( val ); } } fclose( UserFile ); new stringtest[258]; format(stringtest, sizeof(stringtest), "Year:%d, Month:%d, Day:%d, Hour:%d, Minute:%d, Second:%d",BanInfo[playerid][BanYear], BanInfo[playerid][BanMonth], BanInfo[playerid][BanDay], BanInfo[playerid][BanHour], BanInfo[playerid][BanMinute], BanInfo[playerid][BanSecond]); SendClientMessage(playerid, COLOR_GREY, stringtest); } return 1; }
new time = gettime(); format(string, sizeof(string), "TIME: %d", time); SendClientMessage(playerid, COLOR_WHITE, string);
Code:
new time = gettime(); format(string, sizeof(string), "TIME: %d", time); SendClientMessage(playerid, COLOR_WHITE, string); I haw an ideea with gettime() getdate() , but i don't understand the number , i check the clock and it's not the same ... |