01.03.2012, 04:17
(
Last edited by rAzvAn18; 01/03/2012 at 11:56 AM.
)
Hello , I make an advanced ban system , but i have problems at Check Ban ...
I only put a message with the ban info at ban check to se if it's load. I need only a condition to check 2 dates and times,
Ban Date + Time WITH Current Date + Time
I tried this way bellow , but I'm sure that will not work :
I tried different ways , but still not work.
It's the last part of my ban system , please help me !
Sorry for my bad english
I only put a message with the ban info at ban check to se if it's load. I need only a condition to check 2 dates and times,
Ban Date + Time WITH Current Date + Time
I tried this way bellow , but I'm sure that will not work :
Code:
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)
It's the last part of my ban system , please help me !
Code:
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; }