Problem with temporary ban (MySQL)
#1

Код:
publics CheckBan(playerid)
{
    new ip[24],name[MAX_PLAYER_NAME],year,month,days;
    GetPlayerIp(playerid,ip,24);
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
	for(new i = 0; i <= sbans; ++i)
	{
		if(!strcmp(BanInfo[i][Name],name,true))
		{
		    if(getdate(days,month,year) < BanInfo[i][UDate])
		    {
				new string[512],temp[512];
				format(string,sizeof(string),"{00B7FF}Hello {FF0000}%s!\n",name);
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}You account is {FF0000}banned!\n");
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}Banned by {FF0000}%s!\n",BanInfo[i][Admin]);
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}Reason:{FF0000}%s!\n",BanInfo[i][Reason]);
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}Automatically unbaned after {FF0000}%d days!\n",BanInfo[i][Time]);
				strcat(temp, string);
				ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "{00B7FF}Account-Blocked", temp	, "Exit", "");
				DelayedKick(playerid);
				break;
			}
			else
			{
			    orm_delete(BanInfo[i][ORM_ID]);
			    break;
			}
		}
		if(!strcmp(BanInfo[i][IP],ip,true))
		{
		    if(getdate(days,month,year) < BanInfo[i][UDate])
		    {
				new string[512],temp[512];
				format(string,sizeof(string),"{00B7FF}Hello {FF0000}%s!\n",name);
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}You account is {FF0000}banned!\n");
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}Banned by {FF0000}%s!\n",BanInfo[i][Admin]);
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}Reason:{FF0000}%s!\n",BanInfo[i][Reason]);
				strcat(temp, string);
				format(string,sizeof(string),"{00B7FF}Automatically unbaned after {FF0000}%d days!\n",BanInfo[i][Time]);
				strcat(temp, string);
				ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "{00B7FF}Account-Blocked", temp	, "Exit", "");
				DelayedKick(playerid);
				break;
			}
			else
			{
			    orm_delete(BanInfo[i][ORM_ID]);
			    break;
			}
		}
	}
	return 1;
}
The problem is the not checking correctly
But all bans correct loading with system ORM (orm_Addvar_int,addvar_string,etc..) like this system .. )
If i ban player to 10 days (18.01.2016) and enter in the server with this date,server show me that i have account banned
i tested, put the unbandate 07.01.2016 and enter in the server and server show me that i have ban
else i tried to put unbandate 08.01.2016 and 09.01.2016 and it not working ...Help me
Reply
#2

getdate() returns the number of days since the start of the year. Are you looking for gettime()?
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
getdate() returns the number of days since the start of the year. Are you looking for gettime()?
i tried with gettime but it do not work,system ban working on Years,Months,Days,not hours,minutes,seconds!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)