Bugsy, AMXX has natives for dealing with that, you don't need custom include.
PHP Code:
AddToDate(const OriginalDate[], const DaysToAdd, FinalDate[], const Size)
{
new const FormatRule[] = "%d.%m.%Y"
new const SecondsInDay = 86400
new CurrentTimeStamp = parse_time(OriginalDate, FormatRule)
CurrentTimeStamp = CurrentTimeStamp + DaysToAdd * SecondsInDay
format_time(FinalDate, Size, FormatRule, CurrentTimeStamp)
}
You can use something like this, should be better. d is day, m is month, Y is year. You can also change the format of date, use / instead of . or make it m/d/y instead of d/m/y.
An example:
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_srvcmd("output_date", "ServerCommand_OutputDate")
}
public ServerCommand_OutputDate()
{
new CurrentDate[11], FinalDate[11]
get_time("%d.%m.%Y", CurrentDate, charsmax(CurrentDate))
AddToDate(CurrentDate, 5, FinalDate, charsmax(FinalDate))
server_print("CurrentDate: %s | NewDate: %s", CurrentDate, FinalDate)
}
AddToDate(const OriginalDate[], const DaysToAdd, FinalDate[], const Size)
{
new const FormatRule[] = "%d.%m.%Y"
new const SecondsInDay = 86400
new CurrentTimeStamp = parse_time(OriginalDate, FormatRule)
CurrentTimeStamp = CurrentTimeStamp + DaysToAdd * SecondsInDay
format_time(FinalDate, Size, FormatRule, CurrentTimeStamp)
}
__________________