SHARE
TWEET

файл на хэ тэ миэль 5 не читает :(

a guest Sep 5th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (global.CurrentWorld != 999)
  2. {
  3.     var lvl = string(global.CurrentLevel); // current level number
  4.     var wld = string(global.CurrentWorld);
  5.     if (string_length(global.CurrentLevel) < 3)
  6.     {
  7.         if (os_browser != browser_not_a_browser) //dirty HTML5 hack
  8.             var zeros_to_add = (3 - string_length(global.CurrentLevel))-1;
  9.         else
  10.             var zeros_to_add = 3 - string_length(global.CurrentLevel);
  11.        
  12.         for (var i = 0; i < zeros_to_add; i++)
  13.         {
  14.             lvl = string_insert("0",lvl,1);
  15.         }
  16.     }
  17.     show_debug_message("starting level load...");
  18.     file_ensure("levels/World"+wld+"/level"+lvl+".txt");
  19.     var file = file_text_open_read("levels/World"+wld+"/level"+lvl+".txt");
  20. }
  21. else //a custom level
  22. {
  23.     file_ensure(global.CurrentLevel);
  24.     var file = file_text_open_read(global.CurrentLevel);
  25. }
  26.  
  27. var num = 0;
  28. while (!file_text_eof(file))
  29. {
  30.     line[num] = file_text_read_string(file);
  31.     show_debug_message(line[num]);
  32.     num++;
  33.     file_text_readln(file);
  34. }
  35. file_text_close(file);
  36. show_debug_message("finishing level load...");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top