Advertisement
Dannu

Gamemode thing for Kenko

Oct 3rd, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. $gamemodeID = "Insertnameherenospaces";
  2.  
  3. function loadLastGamemodeSave()
  4. {
  5. %path = "saves/RTBAS/" @ $gamemodeID @ "/*.bls";
  6. for(%i=findFirstFile(%path); %i !$= ""; %i= ""))
  7. {
  8. %path = filePath(%i) @ "/" @ filename(%i);
  9. serverDirectSaveFileLoad(%path, 3, 1);
  10. break;
  11. }
  12. }
  13. package serverStartDelay
  14. {
  15. function onPhase3Complete(%a)
  16. {
  17. parent::onPhase3Complete(%a);
  18. schedule(2000, 0, loadLastGamemodeSave);
  19. schedule(20000, RTB_AutoSaver, _doAutoSave);
  20. }
  21. };
  22. activatePackage(serverStartDelay);
  23.  
  24. $nextMapLoop = schedule(TOTAL_CHANGE_TIME_HERE, 0, FUNCTION_THAT_CHANGES_IT_HERE);
  25.  
  26. function timeAnnounceLoop()
  27. {
  28. cancel($timeAnnounceSched);
  29. $timeAnnounceSched = schedule(600000, 0, timeAnnounce);
  30. }
  31.  
  32. function timeAnnounce()
  33. {
  34. %timeMS = timeRemaining($nextMapLoop);
  35. %timeRemainingH = (%timeMS - (%timeMS % 3600000)) / 3600000;
  36. %timeMS = %timeMS - %timeRemainingH * 3600000;
  37. %timeRemainingM = (%timeMS - (%timeMS % 60000)) / 60000;
  38. %timeMS = %timeMS - %timeRemainingM * 60000;
  39. %timeRemainingS = (%timeMS - (%timeMS % 1000)) / 1000;
  40. announce("\c6<font:calibri:30>Time remaining until theme change:\c3" SPC %timeRemainingH @ "\c6:\c3" @ %timeRemainingM @ "\c6:\c3" @ %timeRemainingS @ "\c6!");
  41. timeAnnounceLoop();
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement