JanKy Posted April 8, 2017 Share Posted April 8, 2017 (edited) Hi guys, i need some help, i think this bug is lagging my server, here are the errors and the script. [2017-04-08 15:40:41] WARNING: UNION_ZOMBIES/nz_s.lua:75: Bad argument @ 'createPed' [Expected number at argument 1, got nil] [2017-04-08 15:40:41] WARNING: UNION_ZOMBIES/nz_s.lua:76: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2017-04-08 15:40:41] WARNING: UNION_ZOMBIES/nz_s.lua:77: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2017-04-08 15:40:41] WARNING: UNION_ZOMBIES/nz_s.lua:78: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2017-04-08 15:40:41] WARNING: UNION_ZOMBIES/nz_s.lua:79: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] [2017-04-08 15:40:41] WARNING: UNION_ZOMBIES/nz_s.lua:80: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean] --By Fanbox fast_blood = 15000 -- кровь у сильних sold_blood = 20000 -- кровь у солдатов zomb_blood = 5000 -- кровь у обычных зомби fast_damage = 3111 -- урон сильних sold_damage = 4112 -- урон быстрых зомби zomb_damage = 1121 -- урон обычных зомби --Тварини bear_blood = 20000 wolf_blood = 7000 fox_blood = 5000 bear_damage = 6111 wolf_damage = 3112 fox_damage = 1121 animal_blood = 2000 animal_damage = 100 boss_blood_blood = 75000 boss_blood_damage = 5123 boss_all_blood = 50000 boss_all_damage = 4212 function chasedStartAttack (zomb) if isElement ( zomb ) and not getElementData ( zomb, "target" ) then if getElementData ( zomb, "zHeared" ) then setElementData ( zomb, "zHeared", false ) end setElementSyncer ( zomb, source ) setPedAnimation ( zomb ) if not exports.npc_hlc:isHLCEnabled ( zomb ) then exports.npc_hlc:enableHLCForNPC( zomb, getElementData ( zomb,"speed") or "sprint") end exports.npc_hlc:clearNPCTasks (zomb) exports.npc_hlc:addNPCTask ( zomb, {"killPed", source, 2, 2} ) setElementData ( zomb, "target", source ) setElementAlpha ( zomb, 255 ) end end addEvent( "chasedStartAttackC", true ) addEventHandler( "chasedStartAttackC", getRootElement(), chasedStartAttack ) local stats = { [ 69 ] = 500, [ 70 ] = 999, [ 71 ] = 999, [ 72 ] = 999, [ 73 ] = 500, [ 74 ] = 999, [ 75 ] = 500, [ 76 ] = 999, [ 77 ] = 999, [ 78 ] = 999, [ 79 ] = 999, [ 160 ] = 999, [ 229 ] = 999, [ 230 ] = 999 } function applyStats(player) for stat,value in pairs(stats) do setPedStat(player, stat, value) end end function spawnNewZombie(x, y, z, creator, ztype, skin) local zomb = createPed(skin,x,y,z+0.5,math.random(0,360),true) setElementData(zomb,"spawn_x",x) setElementData(zomb,"spawn_y",y) setElementData(zomb,"spawn_z",z) setElementData(zomb,"spawn_ztype",ztype) setElementData(zomb,"spawn_skin",skin) if isElement ( zomb ) then if not isElementInWater ( zomb ) then setTimer ( activateZombie, 1000, 1, zomb, x, y, z, ztype ) setElementData ( zomb, "creator", creator ) return true else destroyElement ( zomb ) return false end end return false end function activateZombie (zomb, x, y, z, ztype) if isElement ( zomb ) then local zSphere = createColSphere ( x, y, z, 50 ) local zSphereFar = createColSphere ( x, y, z, 150 ) local zSphereNear = createColSphere ( x, y, z, 3 ) attachElements ( zSphere, zomb ) attachElements ( zSphereFar, zomb ) attachElements ( zSphereNear, zomb ) setElementData ( zSphere, 'shapeZomb', true ) setElementData ( zSphereFar, 'shapeZomb', true ) setElementData ( zSphereNear, 'shapeZomb', true ) setElementData ( zomb, "zombieShape", zSphere ) setElementData ( zSphere, "zombieShape", true ) setElementData ( zSphere, "zombieElement", zomb ) setElementData ( zomb, "shapeFar", zSphereFar ) setElementData ( zomb, "shapeNear", zSphereNear ) setElementData ( zSphereNear, "zShapeNear", true ) --setElementData ( zomb, "zombie", true ) --Нападає радіус не великий (ЗОМБИ) --setElementData ( zomb, "animal", true ) --Втікає радіус великий (ЗДОБИЧ) --setElementData ( zomb, "killer", true ) --Нападає радіус великий (ХИЩНИК) --setElementData ( zomb, "boss", true ) --Нападає радіус великий (БОСС) if ztype == 3 then setElementData ( zomb, "zombie", true ) setElementData ( zomb, "soldier", true ) setElementData(zomb, "blood", sold_blood) setElementData(zomb, "damage", sold_damage) setElementData(zomb, "speed", "sprint") elseif ztype == 2 then setElementData ( zomb, "zombie", true ) setElementData(zomb, "blood", fast_blood) setElementData ( zomb, "fast", true ) setElementData(zomb, "damage", fast_damage) setElementData(zomb, "speed", "run") --Тварини --Хищник elseif ztype == 4 then setElementData ( zomb, "killer", true ) setElementData(zomb, "blood", bear_blood) setElementData ( zomb, "bear", true ) setElementData(zomb, "damage", bear_damage) setElementData(zomb, "speed", "run") elseif ztype == 5 then setElementData ( zomb, "killer", true ) setElementData(zomb, "blood", wolf_blood) setElementData ( zomb, "wolf", true ) setElementData(zomb, "damage", wolf_damage) setElementData(zomb, "speed", "sprint") elseif ztype == 6 then setElementData ( zomb, "killer", true ) setElementData(zomb, "blood", fox_blood) setElementData ( zomb, "fox", true ) setElementData(zomb, "damage", fox_damage) setElementData(zomb, "speed", "sprint") --Здобич elseif ztype == 7 then setElementData ( zomb, "animal", true ) setElementData(zomb, "blood", animal_blood) setElementData(zomb, "damage", animal_damage) setElementData(zomb, "speed", "sprint") --Боси --Кровосос elseif ztype == 8 then setElementData ( zomb, "zombie", true ) setElementData ( zomb, "boss_blood", true ) setElementData(zomb, "blood", boss_blood_blood) setElementData(zomb, "damage", boss_blood_damage) setElementData(zomb, "speed", "sprint") setElementAlpha ( zomb, 5 ) --Всі боси elseif ztype == 9 then setElementData ( zomb, "zombie", true ) setElementData ( zomb, "boss_all", true ) setElementData(zomb, "blood", boss_all_blood) setElementData(zomb, "damage", boss_all_blood) setElementData(zomb, "speed", "sprint") elseif ztype == 10 then setElementData ( zomb, "zombie", true ) setElementData ( zomb, "pila", true ) setElementData(zomb, "blood", boss_all_blood) setElementData(zomb, "damage", boss_all_blood) setElementData(zomb, "speed", "run") applyStats(zomb) giveWeapon(zomb, 9, 9999, true) else setElementData ( zomb, "zombie", true ) setElementData(zomb, "blood", zomb_blood) setElementData(zomb, "damage", zomb_damage) setElementData(zomb, "speed", "run") end wentZombieToWalk ( zomb ) end end function wentZombieToWalk (zomb) if zomb then if isElement ( zomb ) then if not isPedDead ( zomb ) then if checkPlayersInView ( zomb ) then if not getElementData ( zomb, "target" ) and not getElementData ( zomb, 'rotating' ) then local rdmangle = math.random( 1, 359 ) setPedRotation( zomb, rdmangle ) setPedAnimation ( zomb, "PED", "WALK_fatold", -1, true, true, true) setTimer ( wentZombieToWalk, 10000, 1, zomb ) if getElementData ( zomb, "boss_blood" ) then setElementAlpha ( zomb, 5 ) end end else if isElement ( getElementData ( zomb, "zombieShape" ) ) then destroyElement ( getElementData ( zomb, "zombieShape" ) ) end if isElement ( getElementData ( zomb, "shapeFar" ) ) then destroyElement ( getElementData ( zomb, "shapeFar" ) ) end if isElement ( getElementData ( zomb, "shapeNear" ) ) then destroyElement ( getElementData ( zomb, "shapeNear" ) ) end local attaches = getAttachedElements ( zomb ) if attaches then for ElementKey, ElementValue in ipairs ( attaches ) do if isElement ( ElementValue ) then if not getElementData ( ElementValue, "zRadZone" ) then destroyElement ( ElementValue ) end end end end local creator = getElementData ( zomb, "creator" ) if isElement ( creator ) then setElementData ( creator, "spawnedzombies", ( getElementData ( creator, "spawnedzombies" ) or 1 ) - 1 ) end setElementData ( zomb, "target", false ) setElementData ( zomb, "rotating", nil ) if not getElementData ( zomb, "target" ) and not getElementData ( zomb, 'rotating' ) then local rdmangle = math.random( 1, 359 ) setPedRotation( zomb, rdmangle ) setPedAnimation ( zomb, "PED", "WALK_fatold", -1, true, true, true) setTimer ( wentZombieToWalk, 10000, 1, zomb ) if getElementData ( zomb, "boss_blood" ) then setElementAlpha ( zomb, 5 ) end end end end end end end function checkPlayersInView ( zomb ) local shapeFar = getElementData ( zomb, "shapeFar" ) if isElement(shapeFar) then if #getElementsWithinColShape ( shapeFar, 'player' ) == 0 then return false else return true end end end function zombieKilledPlayer (task) if getElementData ( source, "zombie" ) then if task[1] == "walkToPos" then if getElementData ( source, "rotating" ) then setElementRotation ( source, 0, 0, task[6] ) setTimer ( function ( zomb ) if isElement ( zomb ) then setElementData ( zomb, "rotating", false ); wentZombieToWalk ( zomb ) end end, 3000, 1, source ) end end if getElementData ( source, "target" ) then local diedPlayer = task[2] setElementData ( source, "target", nil ) wentZombieToWalk ( source ) end end end addEventHandler ( "npc_hlc:onNPCTaskDone", root, zombieKilledPlayer ) function killPlayerOfSick() for i, v in ipairs ( getElementsByType ("ped")) do if getElementData ( v, "zombie" ) then local target = getElementData ( v, "target" ) if target and target == source then setElementData ( v, "target", false ) exports.npc_hlc:clearNPCTasks(v) setTimer ( wentZombieToWalk, 3000, 1, v ) end end end end addEvent("killPlayerOfSick",true) addEventHandler("killPlayerOfSick",getRootElement(),killPlayerOfSick) function checkUnactiveZombies () for i, v in ipairs ( getElementsByType ("ped")) do if getElementData ( v, "zombie" ) then local target = getElementData ( v, "target" ) if target and not isElement ( target ) then setElementData ( v, "target", false ) wentZombieToWalk ( v ) end end end end setTimer (checkUnactiveZombies,10000,0)--600000 function zombieWasAttackedS ( zomb ) if not isPedDead ( zomb ) and not getElementData ( source, "isPlayerZombie" ) then setPedAnimation ( zomb ) if not exports.npc_hlc:isHLCEnabled ( zomb ) then exports.npc_hlc:enableHLCForNPC( zomb, getElementData ( zomb,"speed") or "sprint") end exports.npc_hlc:clearNPCTasks (zomb) exports.npc_hlc:addNPCTask ( zomb, {"killPed", source, 2, 2} ) setElementData ( zomb, "target", source ) setTimer ( wentZombieToWalk, 1000, 1, zomb ) end end addEvent( "zombieWasAttacked", true ) addEventHandler( "zombieWasAttacked", getRootElement(), zombieWasAttackedS ) function zombieHearedS ( zomb ) if isElement ( zomb ) then if not isPedDead ( zomb ) then if not getElementData ( zomb, "target" ) and not getElementData ( source, "zHeared" ) and not getElementData ( source, "isPlayerZombie" ) then setPedAnimation ( zomb ) if not exports.npc_hlc:isHLCEnabled ( zomb ) then exports.npc_hlc:enableHLCForNPC( zomb, getElementData ( zomb,"speed") or "sprint") end exports.npc_hlc:clearNPCTasks (zomb) setElementData ( zomb, "zHeared", source ) local x,y,z = getElementPosition ( source ) exports.npc_hlc:addNPCTask ( zomb, {"walkToPos", x, y, z, 2}) end end end end addEvent( "zombieHeared", true ) addEventHandler( "zombieHeared", getRootElement(), zombieHearedS ) function rotateZombieToPlayer ( rotation, x, y, z ) if not isPedDead ( source ) then if not getElementData ( source, "target" ) then setPedAnimation ( source ) if not exports.npc_hlc:isHLCEnabled ( source ) then exports.npc_hlc:enableHLCForNPC( source, getElementData ( source,"speed") or "sprint") end exports.npc_hlc:clearNPCTasks (source) exports.npc_hlc:addNPCTask ( source, {"walkToPos", x, y, z, 1, rotation}) end end end addEvent( "rotateZombieToPlayer", true ) addEventHandler( "rotateZombieToPlayer", getRootElement(), rotateZombieToPlayer ) function zombieNearLeave ( thePlayer ) if getElementType ( thePlayer ) == "player" and getElementData ( source, "zombieShape" ) then local zomb = getElementData ( source, "zombieElement" ) if isElement ( zomb ) and exports.npc_hlc:isHLCEnabled ( zomb ) then if getElementData ( zomb, "fast" ) then return true end local thistask = getElementData(zomb,"npc_hlc:thistask") if thistask then local task = getElementData(zomb,"npc_hlc:task."..thistask) if task then if task[1] == "killPed" and isElement ( task[2] ) then if task[2] == thePlayer then exports.npc_hlc:clearNPCTasks (zomb) setElementData(zomb,"target",false) wentZombieToWalk(zomb) end end end end end end end addEventHandler ( "onColShapeLeave", root, zombieNearLeave ) --Якшо вас замітив звір function PanicAnimals(zomb) if isElement(zomb) then local rdmangle = math.random( 1, 359 ) setPedRotation( zomb, rdmangle ) setPedAnimation ( zomb, "PED", "sprint_panic", -1, true, true, true) setTimer ( PanicAnimals, 20000, 1, zomb ) --Скільки біжить в один напрям end end function animalStopFollow(zomb) PanicAnimals(zomb) end addEvent("animalStopFollow",true) addEventHandler("animalStopFollow",getRootElement(),animalStopFollow) -- Thanks in advance ^^ Edited April 8, 2017 by JanKy Link to comment
Addlibs Posted April 9, 2017 Share Posted April 9, 2017 Can you show us the part of the code where you call spawnNewZombie? Link to comment
JanKy Posted April 9, 2017 Author Share Posted April 9, 2017 --By Fanbox --1 Прості itemTableZombies = { {"Cuțit de vânătoare",335,1,90,1}, {"Morfină",2976,0.15,0,1}, {"Sticlă de apă",2976,0.15,0,1}, {"Lapte la pungă",2976,0.15,0,1}, {"Bani",2976,0.15,0,3}, } --2 itemTableFastZombies = { -- Прості воєнні {"Mini Pachet cu sânge",2891,2.2,0,1}, {"Compas",2976,0.15,0,1}, {"Chibrituri",2976,0.15,0,1}, {"Costum ( Maro )",2976,0.15,0,1}, {"Bani",2976,0.15,0,5}, } --3 itemTableSoldZombies = { -- вещи солдат с шлемом {"GPS",2976,0.15,0,1}, {"Bandaj",2976,0.15,0,1}, {"Binoclu",2976,0.15,0,1}, {"Măsurător",2976,0.15,0,1}, {"Bani",2976,0.15,0,2}, } --4 bearItems = { {"Carne crudă",2976,0.15,0,10}, } --5 wolfItems = { {"Carne crudă",2976,0.15,0,5}, } --6 foxItems = { {"Carne crudă",2976,0.15,0,4}, } --7 AnimalItems = { {"Carne crudă",2976,0.15,0,3}, } bossBlood = { {"Bani",2976,0.15,0,50}, } bossAll = { {"Bani",2976,0.15,0,50}, } pialarama = { {"Drujbă",2976,0.15,0,1}, } tableZombie = { -- Обичні --LV {1325.6611328125, 1194.2373046875, 10.671875,2,13}, {1415.8837890625, 1091.703125, 10.8203125,1,14}, {1367.529296875, 918.47265625, 10.546276092529,2,13}, {1852.556640625, 892.244140625, 10.8203125,2,10}, {2011.7490234375, 906.841796875, 10.8203125,2,12}, {1905.068359375, 967.830078125, 10.8203125,2,11}, {2057.3032226562, 1039.4567871094, 10.416250228882,2,13}, {2326.376953125, 1355.01953125, 7.1640625,2,14}, {2398.359375, 1478.4306640625, 10.8203125,2,15}, {2386.0888671875, 1542.2802734375, 10.8203125,2,18}, {2320.9013671875, 1609.2685546875, 10.8203125,1,16}, {2355.91796875, 2051.4248046875, 10.734253883362,1,15}, {2229.3037109375, 2451.3818359375, 10.846658706665,1,14}, {1929.630859375, 2346.6845703125, 10.671875,1,13}, {1963.1337890625, 2150.078125, 10.8203125,1,12}, {1766.9755859375, 2019.7607421875, 7.5829572677612,2,10}, {1667.9208984375, 1847.8349609375, 10.8203125,1,11}, {1594.5693359375, 1832.166015625, 10.8203125,2,12}, {1582.287109375, 1853.8564453125, 10.8203125,1,18}, {1277.4599609375, 1359.6328125, 10.8203125,1,17}, {1538.8486328125, 1156.84375, 10.8125,2,17}, {2131.2705078125, 1195.9716796875, 10.671875,1,15}, {2568.11328125, 1028.2822265625, 10.8203125,1,13}, {2738.12109375, 869.4052734375, 10.8984375,1,12}, {2804.60546875, 1376.865234375, 10.75,2,10}, {1665.580078125, 1617.912109375, 10.8203125,2,15}, {1827.171875, 1502.357421875, 8.8069267272949,1,16}, {1768.9130859375, 1246.7578125, 8.5469856262207,2,14}, {1830.5263671875, 956.98828125, 9.8958320617676,2,14}, {1850.72265625, 721.7900390625, 11.354105949402,2,14}, {1927.04296875, 691.6474609375, 10.8203125,1,13}, {1903.5556640625, 733.9921875, 10.8203125,1,12}, {1900.9326171875, 585.380859375, 10.8203125,1,13}, {2125.068359375, 808.259765625, 9.7997341156006,1,10}, {2234.4501953125, 671.373046875, 11.359375,1,10}, {2365.5517578125, 617.759765625, 10.8203125,1,11}, {2564.7431640625, 694.798828125, 10.671875,2,12}, {2401.1162109375, 760.041015625, 10.821153640747,2,13}, {2304.6806640625, 714.4384765625, 10.671875,2,18}, {2427.5087890625, 707.302734375, 10.759969711304,2,11}, {2555.138671875, 780.271484375, 10.8203125,2,10}, {2734.1396484375, 791.943359375, 10.8984375,2,14}, {2734.306640625, 936.5927734375, 10.902780532837,2,13}, {2821.6806640625, 1159.7861328125, 10.853280067444,2,12}, {2667.2431640625, 1286.6953125, 10.8203125,2,11}, {2683.986328125, 1444.1435546875, 9.2593698501587,1,14}, {2772.2275390625, 1664.0654296875, 10.8203125,2,15}, {2666.5693359375, 1878.2666015625, 10.8203125,2,18}, {2844.166015625, 2011.1181640625, 10.671875,1,17}, {2743.5029296875, 2114.9443359375, 13.023113250732,2,16}, {2670.7822265625, 2387.833984375, 8.6207160949707,1,12}, {2582.158203125, 2429.1162109375, 10.8203125,11}, {2523.8056640625, 2250.53125, 10.671875,1,12}, {2573.82421875, 2234.474609375, 12.016069412231,2,11}, {2357.99609375, 2225.2822265625, 11.642976760864,2,11}, {2338.7216796875, 2015.2763671875, 12.330458641052,1,12}, {1436.4853515625, 917.3779296875, 10.8203125,2,10}, {1504.2795410156, 1062.0939941406, 26.669282913208,1,10}, {1608.830078125, 1267.4990234375, 10.8125,1,15}, {1674.0166015625, 1413.35546875, 10.785367012024,1,14}, {1951.419921875, 1359.6171875, 9.109375,1,14}, {1999.546875, 1092.2890625, 10.671875,2,15}, {2118.98828125, 932.4853515625, 10.8203125,2,14}, {2106.388671875, 902.326171875, 10.8203125,2,13}, {2170.73046875, 916.0703125, 10.8203125,2,12}, {2251.2021484375, 976.5068359375, 10.671875,2,11}, {2418.412109375, 1079.5302734375, 10.8203125,1,11}, {2574.3310546875, 1106.9375, 10.8203125,1,11}, {2635.5439453125, 1107.3388671875, 10.8203125,1,10}, {2654.958984375, 1137.166015625, 10.8203125,1,17}, {2522.271484375, 1193.7548828125, 10.923619270325,1,16}, {2493.97265625, 1294.3125, 10.8125,1,15}, {2462.818359375, 1349.0849609375, 10.8203125,1,12}, {2417.9658203125, 1614.9599609375, 10.698512077332,1,13}, {2494.798828125, 1668.1357421875, 10.8203125,2,13}, {2508.283203125, 1822.1220703125, 10.858328819275,2,13}, {2514.1630859375, 1956.26953125, 10.746201515198,2,12}, {2424.1240234375, 1974.5244140625, 10.765051841736,2,18}, {2532.431640625, 2133.58203125, 10.8203125,2,13}, {2802.2412109375, 2200.1484375, 10.8203125,2,10}, {2817.2236328125, 2253.970703125, 10.8203125,1,11}, {2862.583984375, 2398.7880859375, 10.8203125,2,12}, {2898.845703125, 2504.3046875, 11.530093193054,1,15}, {-1112.2832, -1676.9189, 76.367188,2,2}, {-1113.2627, -1637.3428, 76.367188,2,7}, {-2130.6494, -2431.8369, 30.625,1,10}, {-2111.8174, -2407.2715, 31.308962,1,12}, {-2155.6064, -2551.2158, 30.617188,1,13}, {-2173.7197, -2535.7998, 30.617188,1,14}, {-2226.0244, -2401.0332, 31.984375,1,15}, {-2199.3447, -2310.1074, 31.640337,1,16}, {2744.5322, -2447.4521, 13.648438,1,17}, {2451.3145, -2633.4414, 13.662846,1,18}, {2438.2666, -2020.5684, 13.902541,1,10}, {1443.0029, -1602.7178, 13.546875,1,11}, {1498.8623, -1640.9883, 14.046875,1,11}, {1513.377, -1712.4482, 14.046875,1,12}, {1488.1768, -1769.7705, 18.795755,1,13}, {1132.4248, -2035.2051, 69.007813,1,14}, {2659.3672, -1421.7402, 30.464893,1,15}, {2480.6133, -1461.9355, 24.180712,1,16}, {2296.9346, -1519.5459, 27.317057,1,17}, {2143.502, -1484.4697, 25.539063,1,18}, {2127.458, -1313.6748, 25.539063,1,2}, {1802.4668, -1347.917, 15.346227,1,2}, {470.58789, -1843.1367, 4.3484335,1,2}, {209.15039, -1836.6016, 3.7295032,1,2}, {829.30469, -1868.7344, 12.867188,1,2}, {1962.9639, -1392.334, 16.605011,1,2}, {2221.4893, -1056.7988, 46.005867,1,7}, {2278.5898, -1047.5371, 49.488091,1,7}, {340.11914, -1346.1123, 14.507813,1,2}, {1039.6133, -901.16406, 42.461357,1,7}, {1036.959, -1030.7383, 32.073475,1,2}, {1026.7773, -1133.5713, 24.407848,1,2}, {989.76563, -1301.54, 13.51729,1,2}, {1111.3164, -1491.582, 22.769032,1,2}, {748.05957, -548.56738, 16.996553,1,7}, {1045.5723, -301.33203, 73.99308,1,2}, {1111.3926, -312.76074, 73.992188,1,10}, {2324.376, 89.911133, 26.337715,1,11}, {2254.6875, 14.381836, 27.476563,1,12}, {2320.6504, 28.523438, 26.484375,1,13}, {2503.8154, 135.99023, 26.476563,1,14}, {2511.002, -25.285156, 27.658157,1,15}, {1285.8525, 341.95703, 19.554688,1,16}, {1338.4727, 289.27734, 19.561453,1,17}, {1342.0176, 196.70313, 20.223354,1,18}, {1238.1523, 185.26953, 19.554688,1,2}, {1223.916, 293.5498, 19.554688,1,7}, {245.45703, -87.37793, 1.9963558,1,10}, {198.09668, -171.74902, 1.578125,1,11}, {210.03516, -230.13086, 1.7786188,1,12}, {90.02832, -294.65918, 1.578125,1,13}, {-9.4580078, -92.439453, 3.1509881,1,14}, {-10.345703, -65.59375, 3.123158,1,15}, {-6.7509766, -17.583008, 3.2624781,1,16}, {14.706055, 34.75, 3.27057,1,17}, {41.261719, 57.650391, 3.1775858,1,18}, {73.330078, 28.405273, 0.6912424,1,2}, {63.432617, -33.199219, 0.8241868,1,7}, {-74.235352, -5.1064453, 3.1171875,1,10}, {-113.17285, -76.774414, 4.4485888,1,11}, {-100.0293, -333.83887, 1.612601,1,12}, {-23.986328, -286.36328, 5.4296875,1,13}, {681.72266, -663.35742, 16.1875,1,14}, {-1970.416, 86.400391, 27.6875,1,15}, {-1985.9492, 144.25293, 27.6875,1,16}, {-2031.2451, 173.35059, 29.051552,1,17}, {-2122.0273, 252.44727, 35.704983,1,18}, {-2134.876, 129.62207, 35.274288,1,2}, {-2268.4971, 105.94922, 35.171848,1,7}, {-2603.6895, 41.378906, 4.3140945,1,10}, {-2674.3398, -2.3125, 8.0790243,1,11}, {-2668.9609, -171.26465, 4.328125,1,12}, {-2748.4541, -241.61914, 7.1875,1,13}, {-1635.6504, 1202.3994, 7.1796875,1,14}, {-3394.6973, 887.40918, 16.978125,1,15}, {-3388.0566, 863.45605, 17.758034,1,16}, {-3427.3965, 698.66309, 23.263651,1,17}, {-3439.0674, 660.56348, 24.836138,1,18}, {-2678.3135, 1261.333, 55.429688,1,2}, {-2531.377, 1226.0225, 37.428329,1,7}, {-1959.6826, 1326.3359, 7.2042542,1,10}, {-1697.5029, 1266.0557, 7.1796875,1,11}, {-1427.6318, 1493.2012, 7.1015625,1,12}, {-240.0459, 2731.543, 62.6875,1,13}, {-216.87305, 2655.4248, 62.601563,1,14}, {-272.82422, 2614.3066, 62.873177,1,15}, {-319.55273, 2667.8828, 62.83596,1,16}, {1063.4785, 1075.1836, 10.15049,1,17}, {1140.0703, 1022.9004, 11,1,18}, {1664.3828, 1039.5957, 10.820313,1,2}, {1945.2412, 1346.3789, 9.109375,1,7}, {2062.6914, 1893.4609, 11.872293,1,10}, {2198.3965, 1848.7354, 10.820313,1,11}, {2214.6973, 2141.4951, 10.908304,1,12}, {2315.248, 2137.377, 11.303985,1,13}, {2354.623, 2082.1025, 10.671875,1,14}, {2532.2539, 2321.4443, 10.671875,1,15}, {2288.9709, 2354.7952, 11.902043,1,16}, {1609.1992, 2341.7324, 10.820313,1,17}, {1434.3438, 2617.959, 11.392614,1,18}, {1433.832, 2651.418, 11.548323,1,2}, {1420.2637, 2774.1436, 14.820313,1,7}, {1590.4229, 2186.8193, 10.820313,1,10}, {2303.9707, 2775.5127, 10.820313,1,11}, {2892.9453, 2609.2813, 10.916293,1,12}, {1688.1563, 726.63184, 10.820313,1,13}, {1583.8516, 716.7832, 10.820313,1,14}, {-260.16406, -2180.4707, 29.00709,1,15}, {-807.7168, 1560.1914, 26.960938,1,16}, {-722.23828, 1550.9346, 40.680454,1,17}, {-857.95312, 1622.6475, 26.960072,1,18}, {-2471.6758, 2446.9883, 16.254856,1,2}, {-2373.501, 2436.5869, 9.2006359,1,7}, {-2259.1768, 2317.7412, 4.8125,1,10}, {-2460.3018, 2238.0498, 4.7918186,1,11}, {-2553.3701, 2269.4971, 5.0918374,1,12}, {-2610.8271, 2355.6221, 8.6841326,1,13}, --LOGIN PANEL {2256.9905, -2129.4802, -52.017189,1,10}, {2270.7268, -2139.8396, -52.017189,1,11}, {2279.8967, -2148.3464, -52.017189,1,12}, {2296.9231, -2158.323, -52.017189,1,13}, {2316.9309, -2172.0974, -52.017189,1,14}, {2327.8518, -2181.2156, -52.017189,1,15}, {2339.5637, -2190.4431, -52.017189,1,16}, {2301.5901, -2162.3191, -52.017189,1,17}, {2279.7415, -2147.446, -52.017189,1,18}, {2265.6907, -2135.8328, -52.017189,1,48}, {2298.3779, -2099.4795, -52.017189,1,69}, {2312.3401, -2109.3542, -51.859444,1,10}, {2349.4717, -2136.4912, -52.017189,1,11}, {2373.873, -2154.5615, -52.017189,1,12}, {2383.6631, -2159.293, -52.017189,1,13}, {2202.1172, -2189.5454, -52.017189,1,14}, {2217.1787, -2201.7114, -52.017189,1,15}, {2235.3721, -2214.896, -52.017189,1,16}, {2241.3271, -2219.0474, -52.017189,1,17}, {2266.0654, -2234.5552, -52.017189,1,18}, {2274.7061, -2246.1929, -52.017189,1,48}, {2293.3408, -2254.1978, -52.017189,1,69}, --Военні {-1270.1748, 473.52539, 7.1809163,1,48}, {-1240.9219, 446.27441, 7.2773161,1,48}, {-1286.9932, 450.86035, 7.1875,1,48}, {-1333.5557, 436.78613, 7.1809163,1,48}, {-1369.3477, 299.30273, 7.29316,1,48}, {-1391.6836, 320.2373, 7.1875,1,48}, {-1476.3164, 323.43848, 7.1875,1,48}, {-1587.04, 295.98047, 7.1875,1,48}, {-1645.0059, 287.37207, 8.2924271,1,48}, {-1606.0371, 375.06543, 7.1803083,1,48}, {-1567.543, 377.72656, 7.1875,1,48}, {-1540.5937, 439.07422, 7.1875,1,48}, {-1602.9512, 663.83691, 7.1875,1,48}, {-1612.2031, 743.29102, -5.2421875,1,48}, {-1632.1396, 683.05566, -5.2421875,1,48}, {-1986.4193, 569.19336, 48.398438,1,48}, {-1950.3623, 604.72852, 28.040611,1,48}, {-1966.4932, 657.84375, 46.5625,1,48}, {-2699.4482, 600.51172, 14.45455,1,48}, {-2653.6094, 635.5791, 14.524934,1,48}, {-2589.165, 602.23145, 14.453125,1,48}, {-2584.9512, 648.90723, 14.453125,1,48}, {-2587.6799, 578.22754, 40.054688,1,48}, {-2108.5029, 2731.0928, 171.61719,1,48}, {-2063.3369, 2653.9629, 176.12466,1,48}, {-2077.7275, 2695.6343, 166.02322,1,48}, {244.05273, 2462.4521, 16.484375,1,48}, {298.51953, 2542.7939, 16.84856,1,48}, {340.19336, 2537.0947, 16.889799,1,48}, {360.25781, 2537.46, 16.689682,1,48}, {386.55508, 2535.4265, 26.861408,1,48}, {379.29297, 2436.0195, 16.967607,1,48}, {416.28711, 2464.9385, 16.993755,1,48}, {415.59042, 2539.7217, 16.886169,1,48}, {285.55078, 2615.5947, 17.185558,1,48}, {-137.25098, 1219.1774, 20.101736,1,48}, {-18.571289, 1186.0957, 19.433519,1,48}, {12.919922, 1173.6699, 19.483597,1,48}, {67.151367, 1169.8262, 19.608932,1,48}, {103.95801, 1071.9121, 13.609375,1,48}, {59.208008, 1726.415, 17.640625,1,48}, {67.461914, 1795.4404, 17.770092,1,48}, {57.466797, 1881.582, 17.75124,1,48}, {49.293945, 1955.3623, 17.748228,1,48}, {42.249023, 2036.2188, 17.78849,1,48}, {61.885742, 2115.8418, 18.750061,3,69}, {142.47168, 2124.6846, 18.859621,3,69}, {271.78809, 2140.4834, 18.471235,3,69}, {335.90527, 2158.3516, 23.992392,3,69}, {425.83984, 2105.0762, 19.650162,3,69}, {424.14844, 2012.1543, 17.291956,3,69}, {435.75195, 1945.6084, 20.599102,3,69}, {430.12793, 1862.5371, 20.348038,3,69}, {393.86621, 1813.1533, 20.921251,3,69}, {295.91797, 1718.3154, 17.794729,3,69}, {216.72461, 1655.5146, 15.880329,3,69}, {181.50879, 1645.165, 17.586863,3,69}, {133.83398, 1834.9082, 17.640625,3,69}, {111.81543, 1911.9414, 18.791006,3,69}, {133.36328, 1955.0742, 19.429214,3,69}, {171.97656, 1905.6895, 18.327799,3,69}, {206.7373, 1913.3486, 17.640625,3,69}, {272.24121, 1936.6387, 17.640625,3,69}, {256.34082, 1956.2012, 17.936186,3,69}, {357.74219, 1961.6826, 18.007463,3,69}, {273.03027, 1988.1348, 17.973433,3,69}, {302.85645, 2016.2471, 17.640625,3,69}, {268.83691, 2068.2832, 17.640625,3,69}, {223.36621, 2026.748, 17.640625,3,69}, {216.54883, 1965.9609, 17.640625,3,69}, {266.96524, 1886.7, 17.555365,3,69}, {315.21875, 1853.9199, 17.699696,3,69}, {231.20605, 1819.9727, 17.640625,3,69}, {214.91016, 1856.4111, 13.065226,3,69}, {267.28223, 1841.7266, 6.8656588,3,69}, {215.86621, 1822.2109, 6.4140625,3,69}, {281.09082, 1815.9121, 1.0078125,3,69}, {315.30469, 1838.5615, 7.828125,3,69}, {269.68457, 1882.9932, -29.482031,3,69}, {269.87402, 1922.7021, -29.469311,3,69}, {301.91602, 1920.9785, -29.473499,3,69}, {291.19571, 2298.9087, -30.40233,3,69}, {342.77051, 2403.9863, -29.477081,3,69}, {313.87109, 2119.666, -47.876171,3,69}, {442.29865, 2213.7373, -47.829182,3,69}, {598.89532, 2285.7681, -49.186516,3,69}, {807.96777, 2328.062, -47.884716,3,69}, {958.9082, 2312.4248, 10.820313,3,69}, {944.71875, 2363.6064, 10.862807,3,69}, {994.13379, 2363.8057, 10.820313,3,69}, {1015.8311, 2395.6514, 10.753633,3,69}, {2035.6143, 1672.4014, -3.09375,3,69}, {1962.1045, 1595.7852, -2.2476437,3,69}, {1937.0879, 1565.6572, -3.09375,3,69}, {1941.7549, 1569.7793, -3.09375,3,69}, {2063.3142, 1704.4258, -11.77956,3,69}, {1914.8184, 1543.4141, -3.09375,3,69}, {1867.3414, 1490.4176, -1.8257465,3,69}, {1772.946, 1426.8604, -3.1030359,3,69}, {1759.1135, 1374.054, -2.9977174,3,69}, {1649.9082, 1252.1494, -1.5503788,3,69}, {1580.9824, 1181.6191, -3.9986567,3,69}, {1500.7451, 1085.2344, -3.3102732,3,69}, {1548.9023, 1115.2627, 10.887033,3,69}, {1585.0709, 1128.1663, 12.219166,3,69}, {2251.9121, 1770.373, 10.7,3,69}, {2425.4414, 1770.9844, 10.671875,3,69}, {2455.6016, 1709.5264, 10.671875,3,69}, {2409.5303, 1661.3721, 12.153285,3,69}, {2363.1006, 1700.1223, 53.371258,3,69}, {2350.9229, 1797.4824, 72,3,69}, {2365.2891, 1738.1738, 4.5853653,3,69}, {2369.9094, 1766.7532, -2.1245725,3,69}, {2501.344, 1766.9606, -1.994029,3,69}, {2636.8601, 1767.3861, -1.674346,3,69}, {2398.4219, 1732.459, -2.0446343,3,69}, {2375.1431, 1709.1136, -3.09375,3,69}, {2505.1582, 1708.1855, -3.09375,3,69}, {2548.9639, 1707.6006, -3.09375,3,69}, {2296.5137, 1704.924, -3.09375,3,69}, {2190.9756, 1707.126, -3.09375,3,69}, {1784.566, 1416.0564, 7.6963091,3,69}, {1483.1514, 740.47656, 11.466856,3,69}, {1523.8926, 742.23828, 11.023438,3,69}, {1379.7236, 463.97363, 20.141636,3,69}, {1265.0469, 295.5293, 19.554688,3,69}, {1323.085, 206.04785, 19.554688,3,69}, {-720.62988, 2060.8545, 60.382813,3,69}, {2801.5049, 908.92383, 10.75,3,69}, {1557.0049, -1619.9863, 13.546875,3,69}, {1589.2549, -1631.4619, 13.382813,3,69}, {1580.3389, -1707.4482, 5.890625,3,69}, {629.77832, 876.75781, -42.953438,3,69}, {672.97559, 840.42578, -42.960937,3,69}, {565.8291, 816.38477, -29.835567,3,69}, --Острів {-3330.1016, 1604.7939, 3.7987411,1,2}, {-3395.5508, 1517.2178, 11.582377,1,7}, {-3408.8945, 1489.1895, 7.3577094,1,10}, {-3448.6047, 1632.1198, 19.507734,1,11}, {-3573.0195, 1617.1914, 23.775408,1,12}, {-3592.9116, 1505.3137, 24.707779,1,13}, {-3650.0684, 1413.7627, 9.2120609,1,14}, {-3622.5869, 1302.6074, 6.0390625,1,15}, {-3602.4199, 1234.6371, 16.239103,1,16}, {-3788.5205, 1345.5247, 43.130093,1,17}, {-3846.252, 1395.1602, 53.993904,1,18}, {-3905.2563, 1570.2532, 61.664055,1,2}, --Метро {2429.4258, -1965.7441, -52.117187,1,48}, {2361.365, -1982.6121, -56.303307,1,48}, {2336.1831, -2039.6628, -52.103233,1,48}, {2441.9863, -2120.5146, -52.117187,1,48}, {2285.4053, -2028.0596, -52.007835,1,48}, {2096.9917, -1925.9486, -53.744232,1,48}, {1910.2002, -1815.5576, -52.117187,1,48}, {1879.3486, -1808.1602, -51.996788,1,48}, {1521.8655, -1704.7712, -52.117187,1,48}, {1766.6521, -1737.7754, -52.127186,1,48}, {1686.1423, -1694.8855, -51.789841,1,48}, {1538.3962, -1612.8867, -52.117187,1,48}, {1485.6563, -1584.415, -51.980972,1,48}, {2200.5352, -1904.6846, -67,1,48,3,69}, {2176.0625, -1881.0127, -67,3,69}, {2209.5562, -1904.2477, -52.117187,3,69}, {2299.9082, -1927.7187, -52.117187,3,69}, {2497.2266, -1952.207, 13.436157,3,69}, {2463.6152, -1932.7236, 13.370953,3,69}, {2532.3535, -1928.5137, 13.382813,3,69}, {2519.6836, -1890.5381, 13.596931,3,69}, {2451.4248, -1975.3291, 13.553907,3,69}, {1690.5508, -1667.3906, 13.382813,3,69}, {1687.665, -1629.0107, 13.382813,3,69}, {1691.7168, -1595.7754, 13.385181,3,69}, {1690.5508, -1667.3906, 13.382813,3,69}, {1687.665, -1629.0107, 13.382813,3,69}, {1691.7168, -1595.7754, 13.385181,3,69}, {2240.665, 2456.9043, 10.820313,3,69}, {2300.4648, 2484.7441, 3.2734375,3,69}, {2247.624, 2486.6777, 3.2734375,3,69}, {2287.5811, 2484.8506, -7.453125,3,69}, {2252.7002, 2435.5967, -7.453125,3,69}, --Тварини --Ведмідь {-1069.4418945313, -1650.3364257813, 76.350845336914,4,19}, --Вовк {-1016.5682373047, -1688.9556884766, 77.5703125,5,20}, --Лис {-955.28173828125,-1718.2362060547, 77.5703125,6,21}, {-1963.2705, -1988.4971, 78.197479,4,19}, {-1884.3398, -1958.9316, 87.464157,5,20}, {-1789.3398, -2028.8682, 72.968018,6,21}, {-1738.377, -2142.9424, 53.718727,4,19}, {-1640.6895, -2190.1357, 31.547215,5,20}, {-1557.6182, -2072.0879, 44.471111,6,21}, {-1559.6152, -1975.5576, 77.073021,4,19}, {-1569.835, -1876.0254, 81.905136,5,20}, {-1535.3545, -1810.2988, 61.354122,6,21}, {-1423.4707, -1822.584, 45.961006,4,19}, {-1414.2324, -1962.874, 15.397358,5,20}, {-1352.0293, -2044.6465, 9.8601971,6,21}, {-1266.8721, -2092.1982, 24.022167,4,19}, {-1251.085, -2168.4492, 30.99844,5,20}, {-1299.6973, -2269.5762, 30.389217,6,21}, {-1364.5977, -2480.8301, 37.184956,4,19}, {-1364.9297, -2511.7979, 41.842781,5,20}, {-1393.3721, -2553.3467, 54.859398,6,21}, {-1419.4492, -2658.2861, 64.356735,4,19}, {-1444.666, -2723.7852, 62.217419,5,20}, {-1374.248, -2752.1836, 84.98735,6,21}, {-1068.4385, -2646.0859, 82.705215,4,19}, {-1027.3867, -2632.0586, 97.580696,5,20}, {-961.9707, -2539.6094, 102.58094,6,21}, {-1008.0527, -2490.5244, 78.048042,4,19}, {-1048.3301, -2428.1846, 61.675442,5,20}, {-1060.0127, -2353.1133, 53.937428,6,21}, {-1048.9229, -2290.2021, 53.471874,4,19}, {-1038.2588, -2155.8906, 35.318943,5,20}, {-1092.8818, -1997.2627, 47.951172,6,21}, {-1058.1924, -1891.3633, 79.098572,4,19}, {-1007.9863, -1816.2646, 95.206528,5,20}, {-1215.2783, -1610.1406, 67.389191,6,21}, --Здобич --Кіт {-955.28173828125,-1718.2362060547, 77.5703125,7,7,22}, --Курка {-955.28173828125,-1718.2362060547, 77.5703125,7,23}, --Козел {-955.28173828125,-1718.2362060547, 77.5703125,7,24}, --Свиня {-955.28173828125,-1718.2362060547, 77.5703125,7,25}, {-517.96387, -116.09277, 65.208954,7,22}, {-525.46289, -85.623047, 62.454456,7,23}, {-545.90039, -68.977539, 63.386589,7,24}, {-576.65625, -89.675781, 64.538719,7,25}, {-595.65039, -110.49609, 67.378403,7,22}, {-117.89355, 30.324219, 3.1171875,7,23}, {-90.058594, 28.447266, 3.1171875,7,24}, {-73.230469, 30.185547, 3.1171875,7,25}, {-60.289062, 36.345703, 3.1102695,7,22}, {-45.302734, 53.556641, 3.1171875,7,23}, {-37.310547, 30.746094, 3.109396,7,24}, {-13.963867, 38.918945, 3.1096497,7,25}, {2.9970703, 13.279297, 3.1171875,7,22}, {616.57227, 1215.3799, 11.71875,7,23}, {646.87012, 1225.1416, 11.71875,7,24}, {682.03516, 1229.1191, 11.88316,7,25}, {-364.48242, -1439.4209, 25.726563,7,22}, {-376.55371, -1437.6104, 25.726563,7,23}, {-383.39258, -1412.833, 25.726563,7,24}, {-1066.0244, -1072.9033, 129.21875,7,25}, {-1069.4707, -1108.2988, 129.00259,7,22}, {-1060.2314, -1141.1006, 129.21875,7,23}, {-1040.6182, -1169.4307, 129.21875,7,24}, {-1037.7266, -1208.2578, 129.21875,7,25}, {-1064.126, -1234.5, 129.21875,7,22}, {-1477.0039, 2039.0928, 47.383446,7,23}, {-1489.6445, 2019.2412, 47.267853,7,24}, {-1498.3008, 1992.9424, 48.030014,7,25}, {-1506.4951, 1977.0205, 48.421875,7,22}, {-442.08594, 2125.0654, 47.309097,7,23}, {-432.05078, 2156.9111, 44.576134,7,24}, {-436.00781, 2183.7363, 42.501671,7,25}, {-441.59863, 2193.3838, 42.961388,7,22}, {-690.92676, 965.75195, 12.196075,7,23}, {-672.5459, 950.59766, 12.132813,7,24}, {2389.1826, -649.71094, 127.35926,7,25}, {2380.8057, -652.93359, 127.51507,7,22}, {2369.7412, -658.60059, 128.27936,7,23}, {-1423.4053, -955.92871, 201.09375,7,24}, {-1440.0664, -960.15137, 201.09375,7,25}, {-1992.8232, -2418.7998, 30.625,7,22}, {-1975.1426, -2436.4834, 30.625,7,23}, {-1948.8389, -2414.8057, 30.625,7,24}, {-1976.25, -2390.4463, 31.505415,7,22}, --BOSS --Кровосос {-955.28173828125,-1718.2362060547, 77.5703125,8,26}, {-1407.5969, 386.30038, 7.0999999,8,26}, {-726.49219, 2059.3506, 60.327477,8,26}, {1266.6689, -2021.6348, 59.229351,8,26}, {-1013.0723, -660.13086, 32.007813,8,26}, --Пыла {-955.28173828125,-1718.2362060547, 77.5703125,10,27}, {-383.85645, 2226.2246, 42.157539,10,27}, {-2494.2158, -619.93945, 132.5625,10,27}, {-2320.4229, -1647.6133, 483.70313,10,27}, {2601.3076, -633.9873, 130.94301,10,27}, {1084.9678, 1084.9678, 10.835938,10,27}, --Просто боси --[[ {-955.28173828125,-1718.2362060547, 77.5703125,9,28}, {-955.28173828125,-1718.2362060547, 77.5703125,9,29}, {-955.28173828125,-1718.2362060547, 77.5703125,9,30}, {-955.28173828125,-1718.2362060547, 77.5703125,9,31}, ]] {-436.85937, -1422.0469, 21.500454,9,28}, {-1437.1895, -945.85645, 201.05707,9,29}, {-1647.0586, -1960.7842, 97.853058,9,30}, {1330.4248, 104.04395, 22.697889,9,31}, {-1424.8369, -2444.4443, 36.620007,9,28}, {1908.4971, -568.62695, 26.912523,9,29}, {-1490.1025, 2103.9131, 45.989391,9,30}, {-45.751953, 2267.9736, 41.3778,9,31}, {-2764.4941, -784.0166, 27.828051,9,28}, } function createZombie() local totalzombie = 0 for _, data in ipairs(tableZombie) do spawnNewZombie(data[1],data[2],data[3],nil,data[4],data[5]) totalzombie = totalzombie + 1 end outputDebugString("Map "..tostring(totalzombie).." zombies,animals,boss,bots") end createZombie() function destroyDeadZombie (ped,pedCol) destroyElement(ped) destroyElement(pedCol) end zombieKilled = function(killer, headshot) if killer then setElementData(killer, "zombieskilled", getElementData(killer, "zombieskilled") + 1) end local skin = getElementModel(source) local x, y, z = getElementPosition(source) local ped = createPed(skin, x, y, z) local pedCol = createColSphere(x, y, z, 1.5) killPed(ped) setTimer(destroyDeadZombie,3600000, 1, ped, pedCol) attachElements(pedCol, ped, 0, 0, 0) setElementData(pedCol, "parent", ped) setElementData(pedCol, "playername", "Zombie") setElementData(pedCol, "deadman", true) setElementData(ped, "deadzombie", true) setElementData(pedCol, "deadman", true) local creator = getElementData ( source, "creator" ) setTimer ( function () if isElement ( creator ) then setElementData ( creator, "spawnedzombies", ( getElementData ( creator, "spawnedzombies" ) or 1 ) - 1 ) end end, 3600000, 1 ) local spawn_x = getElementData(source,"spawn_x") local spawn_y = getElementData(source,"spawn_y") local spawn_z = getElementData(source,"spawn_z") local spawn_ztype = getElementData(source,"spawn_ztype") local spawn_skin = getElementData(source,"spawn_skin") setTimer(spawnZombieKill,3600000,1,spawn_x,spawn_y,spawn_z,spawn_ztype,spawn_skin) local time = getRealTime() local hours = time.hour local minutes = time.minute setElementData(pedCol,"deadreason","Pare mort, ora morții : "..hours..":"..minutes..".") if getElementData ( source, "soldier" ) then for i,item in ipairs(itemTableSoldZombies) do setElementData(pedCol, item[1], math.random(0,item[5])) end elseif getElementData ( source, "fast" ) then for i,item in ipairs(itemTableFastZombies) do setElementData(pedCol, item[1], math.random(0,item[5])) end --Твварини elseif getElementData ( source, "bear" ) then for i,item in ipairs(bearItems) do setElementData(pedCol, item[1], math.random(1,item[5])) end elseif getElementData ( source, "wolf" ) then for i,item in ipairs(wolfItems) do setElementData(pedCol, item[1], math.random(1,item[5])) end elseif getElementData ( source, "fox" ) then for i,item in ipairs(foxItems) do setElementData(pedCol, item[1], math.random(1,item[5])) end elseif getElementData ( source, "animal" ) then for i,item in ipairs(AnimalItems) do setElementData(pedCol, item[1], math.random(1,item[5])) end elseif getElementData ( source, "boss_blood" ) then for i,item in ipairs(bossBlood) do setElementData(pedCol, item[1], math.random(2,item[5])) end elseif getElementData ( source, "boss_all" ) then for i,item in ipairs(bossAll) do setElementData(pedCol, item[1], math.random(1,item[5])) end elseif getElementData ( source, "pila" ) then for i,item in ipairs(pialarama) do setElementData(pedCol, item[1], math.random(1,item[5])) end -- else for i,item in ipairs(itemTableZombies) do if item[5] then setElementData(pedCol, item[1],math.random(0,item[5])) end end end if isElement ( getElementData(source,"parent") ) then destroyElement(getElementData(source,"parent")) end local attaches = getAttachedElements ( source ) if attaches then for ElementKey, ElementValue in ipairs ( attaches ) do if isElement ( ElementValue ) then if not getElementData ( ElementValue, "zRadZone" ) then destroyElement ( ElementValue ) end end end end if isElement ( getElementData ( source, "zombieShape" ) ) then destroyElement ( getElementData ( source, "zombieShape" ) ) end if isElement ( getElementData ( source, "shapeFar" ) ) then destroyElement ( getElementData ( source, "shapeFar" ) ) end if isElement ( getElementData ( source, "shapeNear" ) ) then destroyElement ( getElementData ( source, "shapeNear" ) ) end destroyElement(source) if headshot == true then setPedHeadless( ped, true ) setElementData(killer, "headshots", getElementData(killer, "headshots") + 1) end end addEvent("onZombieGetsKilled", true) addEventHandler("onZombieGetsKilled", getRootElement(), zombieKilled) function math.percentChance (percent,repeatTime) local hits = 0 for i = 1, repeatTime do local number = math.random(0,200)/2 if number <= percent then hits = hits+1 end end return hits end function spawnZombieKill(spawn_x,spawn_y,spawn_z,spawn_ztype,spawn_skin) spawnNewZombie(spawn_x,spawn_y,spawn_z,false,spawn_ztype,spawn_skin) end This is on server side too: line 619, line 749. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now