19.04.2014, 11:42
title say all
! its not working as i want its showing like this
but i want ! < server has been online for (house,Min,second)
! its not working as i want its showing like this
pawn Код:
It's been up since 19/04/2014 at 16:48
pawn Код:
enum eDateTimeInfo
{
dayx,
monthx,
yearx,
hoursx,
minutesx,
secondsx
};
new gVeryFirstTimestamp = 0; // This will be a reference.
new gWhenDidItStart[eDateTimeInfo]; // This will be an actual date-time.
public OnGameModeInit( )
{
gVeryFirstTimestamp = gettime();
getdate(gWhenDidItStart[yearx], gWhenDidItStart[monthx], gWhenDidItStart[dayx]);
gettime(gWhenDidItStart[hoursx], gWhenDidItStart[minutesx], gWhenDidItStart[secondsx]);
// You could store these variables in a file and just load it everytime the server start
return 1;
}
IRCCMD:uptime(botid, channel[], user[], host[], params[])
{
if (IRC_IsVoice(botid, channel, user))
{
new stringx[128];
new uptime = gettime() - gVeryFirstTimestamp;
format(stringx, sizeof(stringx), "The server has been up for %i seconds.", uptime);
format(stringx, sizeof(stringx), "It's been up since %02i/%02i/%i at %02i:%02i", gWhenDidItStart[dayx], gWhenDidItStart[monthx], gWhenDidItStart[yearx],gWhenDidItStart[hoursx], gWhenDidItStart[minutesx]);
IRC_GroupSay(groupID, channel, stringx);
}
return 1;
}