ban with amount of days
#4

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:
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.
And now when the player is loggin in:
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.");
}
I hope you get the idea
Reply


Messages In This Thread
ban with amount of days - by Geeboi_Mehdi - 10.06.2013, 22:23
Re: ban with amount of days - by Aly - 11.06.2013, 04:30
Re: ban with amount of days - by Geeboi_Mehdi - 11.06.2013, 20:36
Re: ban with amount of days - by Aly - 11.06.2013, 20:49
Re: ban with amount of days - by Geeboi_Mehdi - 11.06.2013, 21:22
Re: ban with amount of days - by MP2 - 11.06.2013, 21:33
Re: ban with amount of days - by zT KiNgKoNg - 11.06.2013, 21:47

Forum Jump:


Users browsing this thread: 2 Guest(s)