Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.70 KB | None | 0 0
  1. ParentMaps = createElement("mapParent")
  2. local idPojazdow = {400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,
  3.     416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433,
  4.     434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451,
  5.     452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469,
  6.     470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487,
  7.     488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505,
  8.     506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523,
  9.     524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541,
  10.     542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559,
  11.     560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577,
  12.     578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595,
  13.     596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611
  14. }
  15. local STEP = 64
  16. local x, y, z, rx, ry, rz = 0.0, 0.0, 4.0, 0.0, 0.0, 0.0
  17. local px, py, pz, prx, pry, prz = 0.0, 0.0, 4.0, 0.0, 0.0, 0.0
  18. local objectsID = {1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325}
  19. function saveMapCacheBIG()
  20.   outputChatBox("Zapychanie Cacheu serwera bez network troblue!")
  21.   for i=1,65536 do
  22.         outputServerLog("Dodano do Cacehu obiektów "..i*2)
  23.         local vehicle = createVehicle(idPojazdow[math.random(1, #idPojazdow)], x, y, z, rx, ry, rz)
  24.         setElementParent(vehicle, ParentMaps)
  25.         x = math.random(1,2) == 1 and x+math.random(20, 50) or x-math.random(20, 50)
  26.         y = math.random(1,2) == 1 and y+math.random(20, 50) or y-math.random(20, 50)
  27.         z = math.random(1,2) == 1 and z+math.random(20, 50) or z-math.random(20, 50)
  28.         rx = math.random(1,2) == 1 and rx+math.random(20, 50) or rx-math.random(20, 50)
  29.         ry = math.random(1,2) == 1 and y+math.random(20, 50) or ry-math.random(20, 50)
  30.         rz = math.random(1,2) == 1 and z+math.random(20, 50) or rz-math.random(20, 50)
  31.         local object = createObject(objectsID[math.random(1, #objectsID)], px, py, pz, prx, pry, prz)
  32.         if isElement(object) then
  33.             setElementParent(object, ParentMaps)
  34.             px = math.random(1,2) == 1 and px+math.random(20, 50) or px-math.random(20, 50)
  35.             py = math.random(1,2) == 1 and py+math.random(20, 50) or py-math.random(20, 50)
  36.             pz = math.random(1,2) == 1 and pz+math.random(20, 50) or pz-math.random(20, 50)
  37.             prx = math.random(1,2) == 1 and prx+math.random(20, 50) or prx-math.random(20, 50)
  38.             pry = math.random(1,2) == 1 and pry+math.random(20, 50) or pry-math.random(20, 50)
  39.             prz = math.random(1,2) == 1 and prz+math.random(20, 50) or prz-math.random(20, 50)
  40.         end
  41.         if i%STEP==0 then
  42.             setTimer(function() coroutine.resume(coroutine_loop) end, 50, 1)
  43.             coroutine.yield()
  44.         end
  45.     end
  46.     outputServerLog("Gotowe!")
  47.     local file = xmlCreateFile("saved.map", "map")
  48.     saveMapData ( file, parent)    
  49.     xmlSaveFile ( file )
  50.     xmlUnloadFile ( file )
  51. end
  52.  
  53. coroutine_loop = coroutine.create(saveMapCacheBIG)
  54. coroutine.resume(coroutine_loop)
  55. saveMapCacheBIG()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement