13.08.2015, 17:47
(
Последний раз редактировалось Dutheil; 15.08.2015 в 14:04.
)
dth_time v0.1 - (Un)format the time
An include with 2 functions allowing you to (un)format a time.
Contents : An include with 2 functions allowing you to (un)format a time.
- 2 functions
Informations :
The functions are based on a particular format.
Before using this include, you must specify the language you use on your gamemode.
PHP код:
enum
{
FR, // French
EN, // English
PT, // Portuguese
PL, // Polish
ES, // Spanish
DE // German
}
#define LANGUAGE FR
Exemple thйorique :PHP код:
native ReturnSecondByDate(const duration[]);
native ReturnDateBySecond(time);
Exemple d'utilisation :
- 2 days 5 hours 30 minutes et 15 secondes : 2d5h30m15s (192 615 secondes)
- 2 days 5 hours et 30 minutes : 2d5h30m (192 600 secondes)
- 2 days et 30 minutes : 2d30m (174 600 secondes)
- 2 days et 15 secondes : 2d15s (172 815 secondes)
- 5 hours et 30 minutes : 5h30m (19 800 secondes)
PHP код:
main()
{
print("_____________________");
print("ReturnSecondByDate");
printf("2j5h30m15s : %d", ReturnSecondByDate("2j5h30m15s"));
printf("2j5h30m : %d", ReturnSecondByDate("2j5h30m"));
printf("2j30m : %d", ReturnSecondByDate("2j30m"));
printf("2j15s : %d", ReturnSecondByDate("2j15s"));
printf("5h30m : %d", ReturnSecondByDate("5h30m"));
print("_____________________");
print("ReturnDateBySecond");
printf("192 615 : %s", ReturnDateBySecond(192615));
printf("192 600 : %s", ReturnDateBySecond(192600));
printf("174 600 : %s", ReturnDateBySecond(174600));
printf("172 815 : %s", ReturnDateBySecond(172815));
printf("19 800 : %s", ReturnDateBySecond(19800));
}