[Problem] Temp Ban
#1

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 :
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)
I tried different ways , but still not work.

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;
}
Sorry for my bad english
Reply
#2

Sombody can help me please ? This part is very important , it's a single condition ...
Reply
#3

Code:
new time = gettime();
format(string, sizeof(string), "TIME: %d", time);
SendClientMessage(playerid, COLOR_WHITE, string);
From that results => "1330609760" What means this ?

I haw an ideea with gettime() getdate() , but i don't understand the number , i check the clock and it's not the same ...
Reply
#4

Quote:
Originally Posted by rAzvAn18
View Post
Code:
new time = gettime();
format(string, sizeof(string), "TIME: %d", time);
SendClientMessage(playerid, COLOR_WHITE, string);
From that results => "1330609760" What means this ?

I haw an ideea with gettime() getdate() , but i don't understand the number , i check the clock and it's not the same ...
That's a unix timestamp.
Reply
#5

Thanks , i searchad on ****** , Now i can finish my ban system .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)