char sTime_Online[32];
GetStringTime(iPlay_Time, sTime_Online, sizeof sTime_Online);
PrintToChatAll("%s", sTime_Online);
void GetStringTime(int iTime, char[] sBuffer, int iMaxLength)
{
static int iDims[] = {60, 60, 24, 30, 12, cellmax};
static char szSign[][] = {"с", "м", "ч", "д", "м", "г"};
static char sForm[][] = {"%02i%s%s", "%02i%s %s", "%i%s %s"};
sBuffer[0] = EOS;
int i = 0, f = -1;
bool bCond = false;
while (!bCond)
{
if (f++ == 1) bCond = true;
do
{
Format(sBuffer, iMaxLength, sForm[f], iTime % iDims[i], szSign[i], sBuffer);
if (iTime /= iDims[i++], iTime == 0) return;
}
while (bCond);
}
}