local spawnPositions = { {1545.3529,-846.4341,68.0673}, {1439.0686,-806.5319,86.4608}, {1215.6058,-623.6701,103.7500}, {1150.1101,-812.8761,53.4620}, {1176.5067,-1324.4878,14.0247}, {993.3409,-1815.5619,14.0994}, {1448.0914,-2287.3130,13.5469}, {1686.3945,-2201.4077,13.5469}, {1743.0483,-1862.4574,13.5763}, {2033.7745,-1406.7250,17.2012}, {1332.0486,-985.0244,33.8966}, {1747.9255,-464.6945,50.5337}, {1709.3138,744.9565,12.6174}, {1679.1981,767.1046,12.2710}, {2470.3784,1023.8534,13.3320}, {2575.8455,1321.9833,10.8203}, {2478.1201,1652.9989,10.8203}, {2262.6440,1785.4316,16.4524}, {2290.4497,2453.6321,10.8203}, {1662.5825,2097.1572,10.8203}, {1687.2134,1940.9889,10.8203}, {1457.7510,2029.8673,14.7396}, {1607.5327,1819.4961,10.8280}, {1677.5142,1449.9734,14.9009}, {796.9202,1974.3610,5.3359}, {83.9083,1172.7161,18.4886}, {-305.8632,1115.2893,19.7493}, {-40.1456,53.7184,6.4844}, {217.4245,-87.6386,1.5684}, {323.9685,-574.6132,9.7228}, {774.2271,-500.0557,22.2444}, {124.2953,2600.4807,20.9170}, {-625.2667,2710.9106,72.3750}, {-767.1581,2742.2473,45.7853}, {-1390.0135,2637.5400,55.9844}, {-1670.3989,2556.8291,85.3047}, {-2382.9729,2542.2722,23.6016}, {-2582.1033,2305.0249,7.0029}, {-2685.2371,1696.2450,67.4397}, {-2871.5483,1003.8621,39.2318}, {-2132.1506,826.3356,69.3878}, {-2516.9482,623.7542,28.2126}, {-2692.6912,100.2719,4.3359}, {-2727.6711,-314.7328,7.0391}, {-2217.5200,-2402.1240,31.8293}, {-2061.6047,-2506.9600,30.7468}, {-1562.7632,-2737.5830,48.5440}, {-42.3457,-2501.5232,36.0568}, } local playerDataTable = { {"alivetime"}, {"skin"}, {"MAX_Slots"}, {"bandit"}, {"blood"}, {"food"}, {"thirst"}, {"temperature"}, {"currentweapon_1"}, {"currentweapon_2"}, {"currentweapon_3"}, {"bleeding"}, {"brokenbone"}, {"pain"}, {"cold"}, {"infection"}, {"humanity"}, {"zombieskilled"}, {"headshots"}, {"murders"}, {"banditskilled"}, {"Firewood"}, {"Bandage"}, {"Water Bottle"}, {"Pasta Can"}, {"Beans Can"}, {"Cereal"}, {"Box of Matches"}, {"M1911 Mag"}, {"M9 SD Mag"}, {"Desert Eagle Mag"}, {"M1911"}, {"M9 SD"}, {"Winchester 1866"}, {"PDW"}, {"Hatchet"}, {"Poptarts"}, {"Morphine"}, {"Soda Bottle"}, {"Empty Jerry Can"}, {"Full Jerry Can"}, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"AK Mag"}, {"M4 Mag"}, {"Tear Gas"}, {"Desert Eagle"}, {"Sawn-Off Shotgun"}, {"SPAZ-12 Combat Shotgun"}, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, {"Lee Enfield"}, {"PDW"}, {"AK-47"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"M136 Rocket"}, {"CZ 550 Mag"}, {"Lee Enfield Mag"}, {"M4"}, {"CZ 550"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Bandit1 Clothing"}, {"Bandit2 Clothing"}, {"Merle Clothing"}, {"Rick Clothing"}, {"Civilian Clothing"}, {"Survivor Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, {"Empty Soda Cans"}, {"Expired Cereal"}, {"1866 Slug"}, {"2Rnd. Slug"}, {"SPAZ-12 Pellet"}, {"Baseball Bat"}, {"Street Sign"}, {"Golf Club"}, {"Parachute"}, } function playerLogin(username, pass, player) local playerID = getAccountData(getPlayerAccount(player),"playerID") account = getPlayerAccount(player) local x,y,z = getAccountData(account,"last_x"),getAccountData(account,"last_y"),getAccountData(account,"last_z") local skin = getAccountData(account,"skin") createZombieTable (player) if getAccountData(account,"isDead") then spawnDayZPlayer(player) return end spawnPlayer (player, x,y,z, math.random(0,360), skin, 0, 0) fadeCamera (player, true) setCameraTarget (player, player) playerCol = createColSphere(x,y,z,1.5) setElementData(player,"playerCol",playerCol) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) for i,data in ipairs(playerDataTable) do local elementData = getAccountData(account,data[1]) setElementData(player,data[1],elementData) end setElementData(player,"logged_in",true) setPedStat(source, 69, 1000) setPedStat(source, 70, 1000) setPedStat(source, 71, 1000) setPedStat(source, 72, 1000) setPedStat(source, 73, 1000) setPedStat(source, 74, 1000) setPedStat(source, 75, 1000) setPedStat(source, 76, 1000) setPedStat(source, 77, 1000) setPedStat(source, 78, 1000) setPedStat(source, 79, 1000) setPedStat(source, 80, 1000) setPedStat(source, 81, 1000) --Weapons --Old Weapons local weapon = getElementData(player,"currentweapon_1") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), true ) end local weapon = getElementData(player,"currentweapon_2") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end local weapon = getElementData(player,"currentweapon_3") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end setElementModel(player,getElementData(player,"skin")) --setElementModel(source,"skin") setElementData(player,"admin",getAccountData(account,"admin") or false) setElementData(player,"moderator",getAccountData(account,"moderator") or false) end addEvent("onPlayerDayZLogin", true) addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin) function playerRegister(username, pass, player) local number = math.random(table.size(spawnPositions)) local x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3] spawnPlayer (player, x,y,z, math.random(0,360), 73, 0, 0) fadeCamera (player, true) setCameraTarget (player, player) playerCol = createColSphere(x,y,z,1.5) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) setPedStat(source, 69, 1000) setPedStat(source, 70, 1000) setPedStat(source, 71, 1000) setPedStat(source, 72, 1000) setPedStat(source, 73, 1000) setPedStat(source, 74, 1000) setPedStat(source, 75, 1000) setPedStat(source, 76, 1000) setPedStat(source, 77, 1000) setPedStat(source, 78, 1000) setPedStat(source, 79, 1000) setPedStat(source, 80, 1000) setPedStat(source, 81, 1000) ---------------------------------- --Player Items on Start for i,data in ipairs(playerDataTable) do if data[1] =="Bandage" then setElementData(player,data[1],2) elseif data[1] =="Painkiller" then setElementData(player,data[1],1) elseif data[1] =="MAX_Slots" then setElementData(player,data[1],8) elseif data[1] =="skin" then setElementData(player,data[1],73) elseif data[1] =="blood" then setElementData(player,data[1],12000) elseif data[1] =="temperature" then