Advertisement
seriu_

Untitled

Nov 27th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. stock ConvertTimeAFK(playerid,result_str[],length,size = sizeof(result_str))
  2. {
  3. result_str[0] = '\0';
  4. if (length > size) {
  5. length = size - 1;
  6. }
  7. if (length < 1) {
  8. return 0;
  9. }
  10. new seconds = PI[playerid][AFK_Time];
  11. new hours,minutes,sec;
  12. if(seconds > 3599){
  13. hours = (seconds/3600);
  14. minutes = (seconds/60) - (hours*60);
  15. sec = (seconds - ((hours*3600)+(minutes*60)));
  16. format(result_str, length, "%d:%02d:%02d",hours,minutes,sec);
  17. }
  18. else if(seconds > 59){
  19. minutes = seconds/60;
  20. sec = (seconds - (minutes*60));
  21. format(result_str, 10, "%d:%02d", minutes, sec);
  22. }
  23. else{
  24. format(result_str, 9, "%d сек", seconds);
  25. }
  26. strins(result_str, "На паузе: ", 0,10);
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement