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;
}
)
|
getdate() returns the number of days since the start of the year. Are you looking for gettime()?
|