Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ParentMaps = createElement("mapParent")
- local idPojazdow = {400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,
- 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433,
- 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451,
- 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469,
- 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487,
- 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505,
- 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523,
- 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541,
- 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559,
- 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577,
- 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595,
- 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611
- }
- local STEP = 64
- local x, y, z, rx, ry, rz = 0.0, 0.0, 4.0, 0.0, 0.0, 0.0
- local px, py, pz, prx, pry, prz = 0.0, 0.0, 4.0, 0.0, 0.0, 0.0
- 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}
- function saveMapCacheBIG()
- outputChatBox("Zapychanie Cacheu serwera bez network troblue!")
- for i=1,65536 do
- outputServerLog("Dodano do Cacehu obiektów "..i*2)
- local vehicle = createVehicle(idPojazdow[math.random(1, #idPojazdow)], x, y, z, rx, ry, rz)
- setElementParent(vehicle, ParentMaps)
- x = math.random(1,2) == 1 and x+math.random(20, 50) or x-math.random(20, 50)
- y = math.random(1,2) == 1 and y+math.random(20, 50) or y-math.random(20, 50)
- z = math.random(1,2) == 1 and z+math.random(20, 50) or z-math.random(20, 50)
- rx = math.random(1,2) == 1 and rx+math.random(20, 50) or rx-math.random(20, 50)
- ry = math.random(1,2) == 1 and y+math.random(20, 50) or ry-math.random(20, 50)
- rz = math.random(1,2) == 1 and z+math.random(20, 50) or rz-math.random(20, 50)
- local object = createObject(objectsID[math.random(1, #objectsID)], px, py, pz, prx, pry, prz)
- if isElement(object) then
- setElementParent(object, ParentMaps)
- px = math.random(1,2) == 1 and px+math.random(20, 50) or px-math.random(20, 50)
- py = math.random(1,2) == 1 and py+math.random(20, 50) or py-math.random(20, 50)
- pz = math.random(1,2) == 1 and pz+math.random(20, 50) or pz-math.random(20, 50)
- prx = math.random(1,2) == 1 and prx+math.random(20, 50) or prx-math.random(20, 50)
- pry = math.random(1,2) == 1 and pry+math.random(20, 50) or pry-math.random(20, 50)
- prz = math.random(1,2) == 1 and prz+math.random(20, 50) or prz-math.random(20, 50)
- end
- if i%STEP==0 then
- setTimer(function() coroutine.resume(coroutine_loop) end, 50, 1)
- coroutine.yield()
- end
- end
- outputServerLog("Gotowe!")
- local file = xmlCreateFile("saved.map", "map")
- saveMapData ( file, parent)
- xmlSaveFile ( file )
- xmlUnloadFile ( file )
- end
- coroutine_loop = coroutine.create(saveMapCacheBIG)
- coroutine.resume(coroutine_loop)
- saveMapCacheBIG()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement