[Include] dth_time - (Un)format the time
#1

dth_time v0.1 - (Un)format the time
An include with 2 functions allowing you to (un)format a time.
Contents :
  • 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 
PHP код:
native ReturnSecondByDate(const duration[]);
native ReturnDateBySecond(time); 
Exemple thйorique :
  • 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)
Exemple d'utilisation :
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));

Very useful for temporary commands (ban, mute, jail...) : "/ban Player 1h30m The reason"

Download :



Reply
#2

Haven't seen the code, but great work. Love new additions in samp
Reply
#3

It is very easy aha, thanks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)