Hello,
I updated the code as above had few bugs. The plugin works fine if I add properly in users.ini. However, when I use amx_addadmin the expirationdate is not correctly added to users.ini. I doubt error is in
Code:
stock getExpirationDate(duration) {
new year, month, day;
date(year, month, day);
day += duration;
switch(month) {
case 1, 3, 5, 7, 8, 10, 12 : {
if(day > 31) {
day -= 31;
month += 1;
}
}
case 2, 4, 6, 9, 11 : {
if(day > 30) {
day -= 30;
month += 1;
}
}
}
new szExpirationDate[15];
formatex(szExpirationDate, charsmax(szExpirationDate), "%d%s%s", year, month >= 10 ? "%d" : "0%d", month, day >= 10 ? "%d" : "0%d", day);
return str_to_num(szExpirationDate);
}
If it is here, could someone point the error ? If not, could someone please check the code and point error ?