11.06.2013, 20:49
Well you'll need 3 new variables in pInfo enum: BanDay,BanMonth,BanYear
Now in your script you have to check if the current month have 31 or 30 days or 28 etc.
Here is an example:
And now when the player is loggin in:
I hope you get the idea
Now in your script you have to check if the current month have 31 or 30 days or 28 etc.
Here is an example:
pawn Код:
if(month == 5 && date+amount > 31)
{
pInfo[giveplayerid][BanDay] = (date+amount) - 31; // amount - number of days you ban the player,date=the current day
pInfo[giveplayerid][BanMonth] = month+1;
pInfo[giveplayerid][BanYear] = year;
}
//Well you have to do this for all cases.
pawn Код:
new day,month,year;
getdate(day,month,year);
if(pInfo[playerid][Banned] == 1)
{
if((pInfo[playerid][BanDay] == day || pInfo[playerid][BanDay] > day)&& pInfo[playerid][BanMonth] == month && pInfo[playerid][BanYear] == year)
{
pInfo[playerid][Banned] = 0;
pInfo[playerid][BanDay] = 0;
pInfo[playerid][BanMonth] = 0;
pInfo[playerid][BanYear] = 0;
}
else if(pInfo[playerid][BanDay] < day && pInfo[playerid][BanMonth] > month && pInfo[playerid][BanYear] == year)
{
pInfo[playerid][Banned] = 0;
pInfo[playerid][BanDay] = 0;
pInfo[playerid][BanMonth] = 0;
pInfo[playerid][BanYear] = 0;
}
else if(pInfo[playerid][BanDay] < day && pInfo[playerid][BanMonth] < month && pInfo[playerid][BanYear] > year)
{
pInfo[playerid][Banned] = 0;
pInfo[playerid][BanDay] = 0;
pInfo[playerid][BanMonth] = 0;
pInfo[playerid][BanYear] = 0;
}
else return SCM(playerid,0xFFFFFFFF,"You are banned from this server.");
}