12.05.2015, 13:21
There is my code, I don't know what is the problem:
Код:
stock GetTimeStamp(form[]) { new hour, minute, second, Hour[5], Minute[5], Second[5], AmPm[5]; gettime(hour, minute, second); if(strfind(form, "tt", false) != -1) format(AmPm, sizeof(AmPm), "%s", (hour >= 12) ? ("PM") : ("AM")), hour = (hour > 12) ? (hour - 12) : (hour), strreplace(form, "tt", AmPm, true); if(strfind(form, "hh", true) != -1) format(Hour, sizeof(Hour), "%02d", hour), strreplace(form, "hh", Hour, true); else if(strfind(form, "h", true) != -1) format(Hour, sizeof(Hour), "%d", hour), strreplace(form, "h", Hour, true); if(strfind(form, "mm", true) != -1) format(Minute, sizeof(Minute), "%02d", minute), strreplace(form, "mm", Minute, true); else if(strfind(form, "m", true) != -1) format(Minute, sizeof(Minute), "%d", minute), strreplace(form, "m", Minute, true); if(strfind(form, "ss", true) != -1) format(Second, sizeof(Second), "%02d", second), strreplace(form, "ss", Second, true); else if(strfind(form, "s", true) != -1) format(Second, sizeof(Second), "%d", second), strreplace(form, "s", Second, true); return form; }