diff --git a/DayZ/configs/cfgClient.lua b/DayZ/configs/cfgClient.lua
index 68d15e6..9e4dbff 100644
--- a/DayZ/configs/cfgClient.lua
+++ b/DayZ/configs/cfgClient.lua
@@ -9,15 +9,15 @@
]]
-- PING CHECK
-gameplayVariables["ping"] = 600 -- Checks if ping is over the set amount. DEFAULT: 600
+gameplayVariables["ping"] = 600 -- Checks if ping is over the set amount - DEFAULT: 600
-- PARAMETER
-gameplayVariables["zombiedamage"] = 650 -- Damage done by zombies - DEFAULT: 650, for consistent damage, remove math.random(400,900) and insert value (EXAMPLE: 1000)
-gameplayVariables["waterdamage"] = math.random(5500,7100) -- Damage received by a player every 4 seconds when it is under water. DEFAULT: math.random(5500,7100).
+gameplayVariables["zombiedamage"] = 650 -- Damage done by zombies - DEFAULT: 650
+gameplayVariables["waterdamage"] = math.random(5500,7100) -- Damage dealt when drowning - DEFAULT: math.random(5500,7100)
-- MISC
gameplayVariables["enablenight"] = true -- Whether or not the night should be darker - DEFAULT: true
-gameplayVariables["armachat"] = false
+gameplayVariables["armachat"] = false -- Activates/deactivates ArmA II style chatbox - DEFAULT: false
-- HEADSHOT MULTIPLIER
gameplayVariables["headshotdamage_player"] = 1.5 -- Multiplier for damage on head shot (player). DEFAULT: 1.5, EXAMPLE: damage*1.5
@@ -26,5 +26,11 @@ gameplayVariables["headshotdamage_zombie"] = 1.5 -- Multiplier for damage on hea
-- SOUND VOLUME
gameplayVariables["ambiencesoundvolume"] = 0.8 -- How loud ambience sounds should be. Set to 0 to disable, max is 1.0. - DEFAULT: 0.8
--- PAIN SHAKE LEVEL
-gameplayVariables["painshakelevel"] = 150 -- How much should the camera shake when in pain. DEFAULT: 150, value can be from 0 - 255
\ No newline at end of file
+-- PAIN SHAKE
+gameplayVariables["painshakesway"] = true -- Determines if camera should sway from left to right or shake violently - DEFAULT: true (= camera will sway)
+gameplayVariables["painshakelevel"] = 150 -- How much should the camera shake when in pain. DEFAULT: 150, value can be from 0 - 255
+
+-- DEBUG MONITOR OPTION
+gameplayVariables["debugmonitorenabled"] = false --Debug Monitor available to the players? DEFAULT: false
+
+outputDebugString("[DayZ] cfgClient loaded")
\ No newline at end of file
diff --git a/DayZ/configs/cfgLoot.lua b/DayZ/configs/cfgLoot.lua
index b15b9c6..3659c00 100644
--- a/DayZ/configs/cfgLoot.lua
+++ b/DayZ/configs/cfgLoot.lua
@@ -8,7 +8,7 @@
#-----------------------------------------------------------------------------#
]]
-outputDebugString("[DayZ] cfgLoot loaded")
+
-- SPAWNPOINTS (ITEMS)
pickupPositions = {
@@ -2713,4 +2713,18 @@ pickupPositions = {
{978.47210693359,-678.15814208984,131.05409240723},
{965.54089355469,-674.3095703125,131.05401611328},
},
-}
\ No newline at end of file
+}
+
+
+zombieBuildingSpawn = {
+-- {zombieSpawnChance,minRoaming,maxRoaming}
+{"Residential",0.3,0,3},
+{"Farm",0.3,0,3},
+{"Supermarket",0.4,2,6},
+{"Military",0.3,0,6},
+{"Industrial",0.3,0,2},
+}
+
+
+
+outputDebugString("[DayZ] cfgLoot loaded")
\ No newline at end of file
diff --git a/DayZ/configs/cfgNutritions.lua b/DayZ/configs/cfgNutritions.lua
index 964f465..77a36df 100644
--- a/DayZ/configs/cfgNutritions.lua
+++ b/DayZ/configs/cfgNutritions.lua
@@ -8,7 +8,6 @@
#-----------------------------------------------------------------------------#
]]
-outputDebugString("[DayZ] cfgNutritions loaded")
gameplayVariables["nutritions"] = {
-- {Name,bloodRegen,calories,food,water,temperature},
@@ -33,4 +32,6 @@ gameplayVariables["nutritions"] = {
{"Soda Can (Mountain Dew)",0,90,0,500,0},
{"Can (Milk)",100,0,380,420,0},
{"Cooked Meat",1000,817,900,0,2},
-}
\ No newline at end of file
+}
+
+outputDebugString("[DayZ] cfgNutritions loaded")
\ No newline at end of file
diff --git a/DayZ/configs/cfgSecurity.lua b/DayZ/configs/cfgSecurity.lua
index eb9cd9f..5a02a22 100644
--- a/DayZ/configs/cfgSecurity.lua
+++ b/DayZ/configs/cfgSecurity.lua
@@ -9,8 +9,6 @@
#-----------------------------------------------------------------------------#
]]
-outputDebugString("[DayZ] cfgSecurity loaded")
-
gameplayVariables["combatlog"] = true -- // Enable/Disable anti combat logging - DEFAULT: true
gameplayVariables["securitylevel"] = 1 -- // Set security level: 2 = Ban, 1 = Kick, 0 = Disabled - DEFAULT: 1
gameplayVariables["bantime"] = 0 -- // If security level is 2, for how long should the player be banned (in seconds)? - 0 = Forever - DEFAULT: 0
@@ -19,3 +17,5 @@ gameplayVariables["packetlossmax"] = 10 -- Set the max packet loss counter - DEF
gameplayVariables["maxslots"] = 30 -- Max slot amount in your server( Include VIP Slots ) - DEFAULT: 30
gameplayVariables["noadvert"] = true -- Banning players who write the server ip
gameplayVariables["adBanTime"] = 86400 -- If noadvert is true, define how much time should the banTime be in seconds. DEFAULT: 86400( 1 Day )
+
+outputDebugString("[DayZ] cfgSecurity loaded")
diff --git a/DayZ/configs/cfgServer.lua b/DayZ/configs/cfgServer.lua
index 1c5c3ac..5aefc5d 100644
--- a/DayZ/configs/cfgServer.lua
+++ b/DayZ/configs/cfgServer.lua
@@ -8,8 +8,6 @@
#-----------------------------------------------------------------------------#
]]
-outputDebugString("[DayZ] cfgServer loaded")
-
shownInfos["nomag"] = "No ammo left for this weapon!"
shownInfos["youconsumed"] = "You consumed"
shownInfos["needwatersource"] = "You have to be inside a body of water!"
@@ -18,21 +16,36 @@ shownInfos["noradio"] = "You have no Radio Device!"
--GAMEPLAY
gameplayVariables["zombieblood"] = 4500 -- Zombie Blood/Health - DEFAULT: 4500
-gameplayVariables["loseWire"] = 1000 -- Amount of losing blood when hitting a Wirefence that's not yours. DEFAULT: 1000
+gameplayVariables["loseWire"] = 1000 -- Amount of losing blood when hitting a Wirefence that's not yours - DEFAULT: 1000
gameplayVariables["playerzombies"] = 6 -- At what amount of zombies should they respawn? - DEFAULT: 6
gameplayVariables["amountzombies"] = 3 -- How often should the script iterate through zombie spawning (= how many zombies should spawn)? - DEFAULT: 3
gameplayVariables["temperaturewater"] = -0.1 -- Amount of temperature to be lost when in water - DEFAULT: -0.01
gameplayVariables["temperaturesprint"] = 0.005 -- Amount of temperature to be gained when sprinting - DEFAULT: 0.005
-gameplayVariables["itemrespawntimer"] = 14400000 -- Number of milliseconds that should elapse before the items will respawn. Note: You can also do math on the number.
+gameplayVariables["itemrespawntimer"] = 14400000 -- Number of milliseconds that should elapse before the items will respawn. Note: You can also do math on the number
gameplayVariables["autostartaddons"] = true -- Allow the gamemode to autostart resources with addon_ prefix
gameplayVariables["enableprone"] = true --Whether or not prone is enabled for players - DEFAULT: true
gameplayVariables["respawnwarning"] = true -- Should the warning "BEWARE OF MASSIVE LAG" when items are being respawned be displayed? If set to true, warning will be displayed. - DEFAULT: true
gameplayVariables["fuelEnabled"] = true -- Is the vehicle fuel enabled? - DEFAULT: true
-gameplayVariables["realtime"] = false -- Enables/Disables real time use. When disabled, gameplayVariables["customtime"] is in effect - DEFAULT: false
+gameplayVariables["realtime"] = false -- Enables/Disables real time use. When set to false, gameplayVariables["customtime"] is in effect - DEFAULT: false
gameplayVariables["customtime"] = 10000 -- How long should an ingame minute be (in ms)? Example: 10000ms (10s) realtime = 1 minute gametime - DEFAULT: 10000
gameplayVariables["pingkick"] = true -- Should the ping kicker be enabled? - DEFAULT: true
gameplayVariables["maxzombiesglobal"] = 600 -- Not in use
-gameplayVariables["maxPetrolFuelAmount"] = math.random(1,15) -- Determine amount of fuel each petrol station in the world contains - DEFAULT: math.random(1,15)
+gameplayVariables["maxPetrolFuelAmount"] = math.random(1,15) -- Determines amount of fuel each petrol station in the world contains - DEFAULT: math.random(1,15)
+gameplayVariables["spawnselection"] = false -- Allow player to select his spawnpoint - DEFAULT: false
+gameplayVariables["explodedvehiclesrespawn"] = 1800000 -- When should exploded vehicles respawn? - DEFAULT: 1800000 (= 30 Min)
+gameplayVariables["watervehiclerespawn"] = 1800000 -- When should vehicles which are submerged in water respawn? - DEFAULT: 1800000 (= 30 Min)
+
+-- EXPERIMENTAL FEATURES
+gameplayVariables["newzombiespawnsystem"] = false -- Experimental feature, zombies only spawn near loot - DEFAULT: false
+gameplayVariables["zombiespawnradius"] = 20 -- If newzombiespawnsystem is set to true, determines the radius where zombies spawn around loot - DEFAULT: 20
+gameplayVariables["maxzombiesperloot"] = 6 -- if newzombiespawnsystem is set to true, determines how many zombies should spawn around loot - DEFAULT: 6
+gameplayVariables["MySQL"] = false -- if MySQL is set to true, MTA:DayZ will use MySQL to store accounts and items of players - DEFAULT: false
+gameplayVariables["MySQL_host"] = "localhost" -- MySQL host IP, example: 127.0.0.1 or localhost
+gameplayVariables["MySQL_port"] = "3306" -- MySQL port, example: 3306
+gameplayVariables["MySQL_user"] = "root" -- MySQL user
+gameplayVariables["MySQL_pass"] = "pass" -- MySQL pass
+gameplayVariables["MySQL_DB"] = "dayz" -- MySQL Database name
+
-- WEIGHT SETTINGS
gameplayVariables["weight_food"] = math.random(25,35) -- The weight that a player takes after eating. DEFAULT: math.random(25,35)
@@ -60,3 +73,8 @@ gameplayVariables["czech_gunslots"] = 6 -- Weapon slots for Czech Backpack - DEF
-- SERVER BACKUP
gameplayVariables["backupenabled"] = true -- Whether or not backup should be enabled. Backup = saves all tents, accounts & vehicles. - DEFAULT: true - Set to false to disable backup.
gameplayVariables["backupinterval"] = 3600000 -- Number of milliseconds that should elapse before backup. Minimum: 50. - 1000 milliseconds = 1 second. - DEFAULT: 3600000ms (= 1 hour)
+
+-- WEAPON SETTINGS
+gameplayVariables["silencedDMRs"] = true
+
+outputDebugString("[DayZ] cfgServer loaded")
\ No newline at end of file
diff --git a/DayZ/configs/cfgSettings.lua b/DayZ/configs/cfgSettings.lua
new file mode 100644
index 0000000..f3da392
--- /dev/null
+++ b/DayZ/configs/cfgSettings.lua
@@ -0,0 +1,13 @@
+--[[
+#-----------------------------------------------------------------------------#
+----* MTA DayZ: cfgSettings.lua *----
+----* Original Author: Marwin W., Germany, Lower Saxony, Otterndorf *----
+
+----* This gamemode is being developed by L, CiBeR96, 1B0Y *----
+----* Type: SHARED *----
+#-----------------------------------------------------------------------------#
+]]
+
+gameplayVariables["newclothingsystem"] = false -- Enables new clothing system with CJ, if disabled (=false), old skins are used - DEFAULT: false
+
+outputDebugString("[DayZ] cfgSettings loaded")
diff --git a/DayZ/gui/achievements/achievements.lua b/DayZ/gui/achievements/achievements.lua
index 2742ba1..7641a7c 100644
--- a/DayZ/gui/achievements/achievements.lua
+++ b/DayZ/gui/achievements/achievements.lua
@@ -1,6 +1,6 @@
--[[
#-----------------------------------------------------------------------------#
-----* MTA DayZ: achievements.lua *----
+----* MTA DayZ: achievements.lua *----
----* Original Author: Marwin W., Germany, Lower Saxony, Otterndorf *----
----* This gamemode is being developed by L, CiBeR96, 1B0Y *----
@@ -17,7 +17,7 @@ GUIEdit = {
function panel(state)
if not GUIEdit.staticimage[1] then
GUIEdit.staticimage[1] = guiCreateStaticImage(0.00, -0.15, 0.31, 0.14, "gui/achievements/icons/bg_achievements.png", true)
- guiSetAlpha(GUIEdit.staticimage[1], 0.87)
+ guiSetAlpha(GUIEdit.staticimage[1], 1.00)
guiBringToFront(GUIEdit.staticimage[1])
GUIEdit.staticimage[2] = guiCreateStaticImage(0.04, 0.16, 0.29, 0.67, "gui/gear/items/white.png", true, GUIEdit.staticimage[1])
@@ -87,6 +87,7 @@ function giveAchievement(ID)
end
function check() -- Needs optimizing
+ if not getElementData(localPlayer,"logedin") then return end
local achievementsunlocked = getAchievements()
local counter = 0
for i, all in pairs(achievements) do
@@ -96,20 +97,41 @@ function check() -- Needs optimizing
if getElementData(getLocalPlayer(),cond[1]) > tonumber(cond[3]) then
counter = counter+1
end
- elseif(cond[2] == "equal") then
+ elseif (cond[2] == "equal") then
if getElementData(getLocalPlayer(),cond[1]) == cond[3] then
counter = counter+1
end
- elseif(cond[2] == "less" and cond[3]) then
+ elseif (cond[2] == "less" and cond[3]) then
if getElementData(getLocalPlayer(),cond[1]) < tonumber(cond[3]) then
counter = counter+1
end
- elseif(cond[2] == "misc_zaxis") then
+ elseif (cond[2] == "misc_zaxis") then
local x,y,z = getElementPosition(localPlayer)
-- outputChatBox(assert(loadstring("return "..tostring(cond[1])))()) -- Don't load > 100 above ground (idk why)
if z >= 300 then
counter = counter+1
end
+ elseif (cond[2] == "clothes") then
+ local playerClothesShirt = getPedClothes(localPlayer,0)
+ local playerClothesHead = getPedClothes(localPlayer,1)
+ local playerClothesPants = getPedClothes(localPlayer,2)
+ if playerClothesShirt == "player_torso" then
+ if playerClothesHead == "player_face" then
+ if playerClothesPants == "player_legs" then
+ counter = counter+1
+ end
+ end
+ end
+ elseif cond[2] == "area" then
+ local x,y,z = getElementPosition(localPlayer)
+ if getDistanceBetweenPoints3D(x,y,z,213,1898,17) <= 25 then
+ counter = counter+1
+ end
+ elseif cond[2] == "carrier" then
+ local x,y,z = getElementPosition(localPlayer)
+ if getDistanceBetweenPoints3D(x,y,z,-1325,502,18) <= 25 then
+ counter = counter+1
+ end
end
if(counter == #all["conditions"]) then
giveAchievement(i)
diff --git a/DayZ/gui/crosshair/crosshair.lua b/DayZ/gui/crosshair/crosshair.lua
index f161287..04e1057 100644
--- a/DayZ/gui/crosshair/crosshair.lua
+++ b/DayZ/gui/crosshair/crosshair.lua
@@ -39,7 +39,8 @@ function setCrossHairSize(weapon)
end
addEventHandler("onClientPlayerWeaponFire",localPlayer,setCrossHairSize)
-function drawCrosshair()
+function drawCrosshair()
+ if getElementData(localPlayer,"fracturedArms") then return end
local hX,hY,hZ = getPedTargetEnd ( getLocalPlayer() )
local screenX1, screenY1 = getScreenFromWorldPosition ( hX,hY,hZ )
if screenX1 then
@@ -73,7 +74,7 @@ end
bindKey("aim_weapon", "both", function(key, state)
local weapon = getPedWeapon(getLocalPlayer())
if gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "hardcore" then return end
- if weapon ~= 0 and weapon ~=1 then
+ if weapon ~= 0 and weapon ~=1 then
if state == "down" then
addEventHandler("onClientRender", root, drawCrosshair)
else
diff --git a/DayZ/gui/gear/functions_gear.lua b/DayZ/gui/gear/functions_gear.lua
index 89c6043..5e85062 100644
--- a/DayZ/gui/gear/functions_gear.lua
+++ b/DayZ/gui/gear/functions_gear.lua
@@ -141,9 +141,11 @@ function onPlayerMoveItemOutOFInventory (itemName,loot)
elseif itemName == "Lee Enfield" or itemName == "AK-74" or itemName == "AKS-74U" or itemName == "RPK" or itemName == "AKM" or itemName == "Sa58V CCO" or itemName == "Sa58V RCO" or itemName == "FN FAL" or itemName == "M24" or itemName == "DMR" or itemName == "M40A3" or itemName == "G36A CAMO" or itemName == "G36C" or itemName == "G36C CAMO" or itemName == "G36K CAMO" or itemName == "L85A2 RIS Holo" or itemName == "M16A2" or itemName == "M16A2 M203" or itemName == "M16A2" or itemName == "M16A4" or itemName == "CZ 550" or itemName == "SVD Dragunov" or itemName == "Mosin-Nagant" or itemName == "Winchester 1866" or itemName == "Double-barreled Shotgun" or itemName == "M1014" or itemName == "Remington 870" or itemName == "Compound Crossbow" or itemName == "Hatchet" or itemName == "Bizon PP-19 SD" or itemName == "MP5A5" then
triggerServerEvent("removeBackWeaponOnDrop",localPlayer)
end
-
- if itemName == "Military collar" or itemName == "Africa collar" or itemName == "LS collar" or itemName == "Gold collar" or itemName == "Silver collar" or itemName == "Black Bandana (M)" or itemName == "Blue Bandana (M)" or itemName == "Green Bandana (M)" or itemName == "Red Bandana (M)" or itemName == "Dark Glasses" or itemName == "Red Glasses" or itemName == "Square Glasses" or itemName == "Black Bandana (H)" or itemName == "Blue Bandana (H)" or itemName == "Green Bandana (H)" or itemName == "Red Bandana (H)" or itemName == "Black Beret" or itemName == "Red Beret" or itemName == "Old Hat" or itemName == "Black Hat" or itemName == "Yellow Hat" or itemName == "Black Trucker" or itemName == "Blue Trucker" or itemName == "Green Trucker" or itemName == "Red Trucker" or itemName == "Yellow Trucker" or itemName == "Cow-Boy Hat" or itemName == "White Hat" or itemName == "Hockey Mask" or itemName == "Black Shoe" or itemName == "Sport Shoe" or itemName == "Brown Shoe" or itemName == "Biker Shoe" or itemName == "Blue Shoe" or itemName == "Red Shoe" or itemName == "Beach Shoe" or itemName == "Black Pants" or itemName == "Beige Pants" or itemName == "Gray Shorts" or itemName == "Blue Shorts" or itemName == "Blue Jeans" or itemName == "Green Jeans" or itemName == "Gray Pants" or itemName == "Yellow Pants" or itemName == "Blue Jogging" or itemName == "Gray Jogging" or itemName == "Military Pants" or itemName == "Beige Vest" or itemName == "Baseball Shirt" or itemName == "Baseball 2 Shirt" or itemName == "Red Vest" or itemName == "Grey Shirt" or itemName == "Green Vest" or itemName == "Hawai Shirt" or itemName == "Black Vest" or itemName == "Brown Vest" or itemName == "Biker Vest" or itemName == "Blue Shirt" or itemName == "Green 2 Vest" or itemName == "Number 5 Shirt" or itemName == "Monk Shirt" then
- triggerServerEvent("checkPlayerClothes",localPlayer,itemName)
+
+ if gameplayVariables["newclothingsystem"] then
+ if itemName == "Military collar" or itemName == "Africa collar" or itemName == "LS collar" or itemName == "Gold collar" or itemName == "Silver collar" or itemName == "Black Bandana (M)" or itemName == "Blue Bandana (M)" or itemName == "Green Bandana (M)" or itemName == "Red Bandana (M)" or itemName == "Dark Glasses" or itemName == "Red Glasses" or itemName == "Square Glasses" or itemName == "Black Bandana (H)" or itemName == "Blue Bandana (H)" or itemName == "Green Bandana (H)" or itemName == "Red Bandana (H)" or itemName == "Black Beret" or itemName == "Red Beret" or itemName == "Old Hat" or itemName == "Black Hat" or itemName == "Yellow Hat" or itemName == "Black Trucker" or itemName == "Blue Trucker" or itemName == "Green Trucker" or itemName == "Red Trucker" or itemName == "Yellow Trucker" or itemName == "Cow-Boy Hat" or itemName == "White Hat" or itemName == "Hockey Mask" or itemName == "Black Shoe" or itemName == "Sport Shoe" or itemName == "Brown Shoe" or itemName == "Biker Shoe" or itemName == "Blue Shoe" or itemName == "Red Shoe" or itemName == "Beach Shoe" or itemName == "Black Pants" or itemName == "Beige Pants" or itemName == "Gray Shorts" or itemName == "Blue Shorts" or itemName == "Blue Jeans" or itemName == "Green Jeans" or itemName == "Gray Pants" or itemName == "Yellow Pants" or itemName == "Blue Jogging" or itemName == "Gray Jogging" or itemName == "Military Pants" or itemName == "Beige Vest" or itemName == "Baseball Shirt" or itemName == "Baseball 2 Shirt" or itemName == "Red Vest" or itemName == "Grey Shirt" or itemName == "Green Vest" or itemName == "Hawai Shirt" or itemName == "Black Vest" or itemName == "Brown Vest" or itemName == "Biker Vest" or itemName == "Blue Shirt" or itemName == "Green 2 Vest" or itemName == "Number 5 Shirt" or itemName == "Monk Shirt" or itemName == "Helmet" or itemName == "MX Helmet" then
+ triggerServerEvent("checkPlayerClothes",localPlayer,itemName)
+ end
end
if loot then
@@ -325,9 +327,23 @@ function onClientOpenInventoryStopMenu()
triggerEvent("disableMenu", localPlayer)
end
+--[[
+function isPlayerInLoot()
+ if getElementData(localPlayer, "loot") and (getElementType(getElementData(localPlayer,"loot")) == "player") then
+ local element = getElementData(localPlayer, "currentCol")
+ if not element then
+ return false
+ end
+
+ return element
+ end
+ return false
+end
+]]
+
function isPlayerInLoot()
- if getElementData(localPlayer, "loot") then
- return getElementData(localPlayer, "currentCol")
+ if getElementData(localPlayer,"loot") then
+ return getElementData(localPlayer,"currentCol")
end
return false
end
@@ -351,7 +367,21 @@ function playerUseItem(itemName,itemInfo)
triggerServerEvent("onPlayerRequestChangingStats",localPlayer,itemName,itemInfo,"food")
end
elseif itemInfo == "Put clothes on" then
- triggerServerEvent("onPlayerChangeClothes",localPlayer)
+ if gameplayVariables["newclothingsystem"] then
+ if itemName == "Survivor Clothing" or itemName == "Survivor Clothing (Female)" or itemName == "Civilian Clothing" or itemName == "Civilian Clothing (Female)" or itemName == "Camouflage Clothing" or itemName == "Ghillie Suit" then
+ triggerEvent("displayClientInfo", localPlayer, "Clothes", "You can't wear this!", 255, 0, 0)
+ return
+ else
+ triggerServerEvent("onPlayerChangeClothes",localPlayer)
+ end
+ else
+ if itemName == "Military collar" or itemName == "Africa collar" or itemName == "LS collar" or itemName == "Gold collar" or itemName == "Silver collar" or itemName == "Black Bandana (M)" or itemName == "Blue Bandana (M)" or itemName == "Green Bandana (M)" or itemName == "Red Bandana (M)" or itemName == "Dark Glasses" or itemName == "Red Glasses" or itemName == "Square Glasses" or itemName == "Black Bandana (H)" or itemName == "Blue Bandana (H)" or itemName == "Green Bandana (H)" or itemName == "Red Bandana (H)" or itemName == "Black Beret" or itemName == "Red Beret" or itemName == "Old Hat" or itemName == "Black Hat" or itemName == "Yellow Hat" or itemName == "Black Trucker" or itemName == "Blue Trucker" or itemName == "Green Trucker" or itemName == "Red Trucker" or itemName == "Yellow Trucker" or itemName == "Cow-Boy Hat" or itemName == "White Hat" or itemName == "Hockey Mask" or itemName == "Black Shoe" or itemName == "Sport Shoe" or itemName == "Brown Shoe" or itemName == "Biker Shoe" or itemName == "Blue Shoe" or itemName == "Red Shoe" or itemName == "Beach Shoe" or itemName == "Black Pants" or itemName == "Beige Pants" or itemName == "Gray Shorts" or itemName == "Blue Shorts" or itemName == "Blue Jeans" or itemName == "Green Jeans" or itemName == "Gray Pants" or itemName == "Yellow Pants" or itemName == "Blue Jogging" or itemName == "Gray Jogging" or itemName == "Military Pants" or itemName == "Beige Vest" or itemName == "Baseball Shirt" or itemName == "Baseball 2 Shirt" or itemName == "Red Vest" or itemName == "Grey Shirt" or itemName == "Green Vest" or itemName == "Hawai Shirt" or itemName == "Black Vest" or itemName == "Brown Vest" or itemName == "Biker Vest" or itemName == "Blue Shirt" or itemName == "Green 2 Vest" or itemName == "Number 5 Shirt" or itemName == "Monk Shirt" then
+ triggerEvent("displayClientInfo", localPlayer, "Clothes", "You can't wear this!", 255, 0, 0)
+ return
+ else
+ triggerServerEvent("onPlayerChangeSkin",localPlayer,itemName)
+ end
+ end
elseif itemName == "Empty Water Bottle" then
triggerServerEvent("onPlayerRefillWaterBottle",localPlayer,itemName)
elseif itemName == "Tent" then
diff --git a/DayZ/gui/gear/hud_gear.lua b/DayZ/gui/gear/hud_gear.lua
index 9725a0e..fee6160 100644
--- a/DayZ/gui/gear/hud_gear.lua
+++ b/DayZ/gui/gear/hud_gear.lua
@@ -48,11 +48,13 @@ function playerDrawMapGPSCompass()
end
if getElementData(getLocalPlayer(),"GPS") >= 1 then
if not gpskeybound then
+ bindKey("7","down",toggleGPS)
addCommandHandler("gps",toggleGPS)
gpskeybound = true
end
else
if gpskeybound then
+ unbindKey("7","down",toggleGPS)
removeEventHandler("onClientRender",root,drawTheGPS)
removeCommandHandler("gps",toggleGPS)
dxSetRenderTarget()
@@ -80,11 +82,13 @@ function playerDrawMapGPSCompass()
end
if getElementData(getLocalPlayer(),"Compass") >= 1 then
if not compasskeybound then
+ bindKey("8","down",toggleCompass)
addCommandHandler("compass",toggleCompass)
compasskeybound = true
end
else
if compasskeybound then
+ unbindKey("8","down",toggleCompass)
removeEventHandler("onClientRender",root,drawTheCompass)
removeCommandHandler("compass",toggleCompass)
compasskeybound = false
@@ -120,6 +124,7 @@ function toggleGPS()
end
end
+
function toggleCompass()
if not isCompassShown then
isCompassShown = true
@@ -284,7 +289,6 @@ function playerActivateGoggles (key,keyState)
guiSetVisible(infravision,false)
showChat(false)
setCameraGoggleEffect("nightvision")
- setFarClipDistance(1000)
triggerEvent("onPlayerEnabledGoggles", getLocalPlayer())
end
end
@@ -497,7 +501,9 @@ setElementData(statsLabel["name"],"identifikation","name")
function showDebugMintorOnLogin ()
if getElementData(localPlayer,"logedin") then
- --guiSetVisible(statsWindows,true)
+ if (gameplayVariables["debugmonitorenabled"]) then
+ guiSetVisible(statsWindows,true)
+ end
end
end
addEvent("onClientPlayerDayZLogin", true)
@@ -506,18 +512,18 @@ addEventHandler("onClientPlayerDayZLogin", root, showDebugMintorOnLogin)
local isVisible = false
function showDebugMonitorOnF5()
if getElementData(localPlayer,"logedin") then
- if not isVisible then
- guiSetVisible(statsWindows,true)
- isVisible = true
- else
- guiSetVisible(statsWindows,false)
- isVisible = false
- end
+ if not (gameplayVariables["debugmonitorenabled"]) then return end
+
+ guiSetVisible(statsWindows,not guiGetVisible(statsWindows))
else
guiSetVisible(statsWindows,false)
end
end
---bindKey("F5","down",showDebugMonitorOnF5)
+if not (gameplayVariables["debugmonitorenabled"]) then
+ return
+else
+ bindKey("F5","down",showDebugMonitorOnF5)
+end
function showDebugMonitor()
--guiSetVisible(statsWindows,true)
@@ -564,4 +570,4 @@ function refreshDebugMonitor()
guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer()))
end
end
---setTimer(refreshDebugMonitor,1000,0)
\ No newline at end of file
+setTimer(refreshDebugMonitor,1000,0)
diff --git a/DayZ/gui/gear/language_gear.lua b/DayZ/gui/gear/language_gear.lua
index e670842..f98baaf 100644
--- a/DayZ/gui/gear/language_gear.lua
+++ b/DayZ/gui/gear/language_gear.lua
@@ -223,6 +223,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Item", "A bottle of water that has been\nfiltered and can be consumed.\nIt's empty, though.","Empty Water Bottle", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Soda Can"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -544,6 +546,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Item", "Eine Flasche gefiltertes Wasser.\nIst allerdings leer.","Wasserflasche (Leer)", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Item", "Enthielt einst ein köstliches Getränk,\nist jetzt aber leer und kaputt.","Leere Getränkedose"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -864,6 +868,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Předmět", "Láhev filtrované vody.\nMomentálně je prázdná.\nLze naplnit a vyfiltrovat u řeky.","Prázdná láhev", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Předmět", "Prázdná hliněná plechovka.","Prázdná plechovka"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -1183,7 +1189,9 @@ languageTextTable = {
{"Monk Shirt",1,'clothes.png',128,128,"Item","No description available","Monk Shirt","Put clothes on"},
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
- {"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Item", "Een fles water die is \n gefilterd en geconsumeerd kan worden. \n Het is leeg, dat wel.","Lege Fles Water", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Item", "Een aluminium blikje dat ooit \n een smakelijke koolzuurhoudende drank bevatte, \n maar bevat nu niets.","Lege Blikjes Frisdrank"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -1501,7 +1509,9 @@ languageTextTable = {
{"Monk Shirt",1,'clothes.png',128,128,"Item","No description available","Monk Shirt","Put clothes on"},
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
- {"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128, "Item", "Uma garrafa de água que foi\nfiltrada e consumida.\nEstá vazia, por enquanto...", "Garrafa de Água [Vazia]", "Fill bottle up"},
{"Empty Soda Can", 1, 'emptysoda.png', 128, 128, "Item", "Uma lata de alumínio que uma vez que continha\numa bebida gaseificada saborosa, \ne agora contém nada.", "Latas de Refri [Vazias]"},
{"Empty Tin Can", 1, 'emptysoda.png', 128, 128, "Item", "Uma lata de alumínio que continha\numa saborosa bebida carbonatada, \ne agora não contém nada.", "Lata [Vazia]]"},
@@ -1821,6 +1831,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"物品", "被喝光了.","空水壶", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"物品", "被喝光了.","空的苏打罐子"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -2139,6 +2151,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Artículo", "Una botella de agua que ha sido\nfiltrada y se puede consumir.\nEstá vacía","Botella de Agua Vacía", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Artículo", "Una lata de aluminio que una vez contenía\nuna bebida carbonatada sabrosa,\ny ahora contiene nada.","Lata de Refrescos Vacía"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -2457,6 +2471,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Item", "Une bouteille d'eau qui a été filtré et peut\nêtre consommé. Mais elle semble vide.","Bouteille d'eau (Vide)", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Item", "Une canette en aluminium qui ne contient rien.","Canette de soda (Vide)"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -2773,6 +2789,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Item", "O sticlă goală de apă.","Sticlă goală de apă", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Item", "O sticlă goală de suc.","Sticlă goală de suc"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Item", "A aluminium can that once contained\na tasty carbonated beverage,\nand now contains nothing.","Empty Tin Can"},
@@ -3089,6 +3107,8 @@ languageTextTable = {
{"Dark Glasses",1,'clothes.png',128,128,"Item","No description available","Dark Glasses","Put clothes on"},
{"Square Glasses",1,'clothes.png',128,128,"Item","No description available","Square Glasses","Put clothes on"},
{"Red Glasses",1,'clothes.png',128,128,"Item","No description available","Red Glasses","Put clothes on"},
+ {"Helmet",1,'clothes.png',128,128,"Item","No description available","Helmet","Put clothes on"},
+ {"MX Helmet",1,'clothes.png',128,128,"Item","No description available","MX Helmet","Put clothes on"},
{"Empty Water Bottle", 1, 'emptybottle.png', 128, 128,"Przedmiot", "Pusta butelka, może być\nnapełniona wodą z dowolnego zbiornika","Pusta butelka", "Fill bottle up"},
{"Empty Soda Can", 1,'emptysoda.png', 128, 128,"Przedmiot", "Puszka aluminiowa... już pusta","Pusta puszka"},
{"Empty Tin Can", 1,'emptysoda.png', 128, 128,"Przedmiot", "Puszka aluminiowa... już pusta","Pusta puszka jedzenia"},
@@ -3338,11 +3358,12 @@ itemWeightTable = {
{"Cooked Meat",1,"Item"},
{"Radio Device",0,"Item"},
{"Compass",0,"Item"},
---{"Camouflage Clothing",1,"Item"},
---{"Civilian Clothing",1,"Item"},
---{"Survivor Clothing",1,"Item"},
---{"Survivor Clothing (Female)",1,"Item"},
---{"Civilian Clothing (Female)",1,"Item"},
+{"Camouflage Clothing",1,"Item"},
+{"Civilian Clothing",1,"Item"},
+{"Survivor Clothing",1,"Item"},
+{"Survivor Clothing (Female)",1,"Item"},
+{"Civilian Clothing (Female)",1,"Item"},
+{"Ghillie Suit",1,"Item"},
{"Military collar",0,"Item"},
{"Africa collar",0,"Item"},
{"Gold collar",0,"Item"},
@@ -3404,7 +3425,8 @@ itemWeightTable = {
{"Dark Glasses",0,"Item"},
{"Square Glasses",0,"Item"},
{"Red Glasses",0,"Item"},
---{"Ghillie Suit",1,"Item"},
+{"MX Helmet",0,"Item"},
+{"Helmet",0,"Item"},
{"Empty Water Bottle",1,"Item"},
{"Empty Soda Can",1,"Item"},
{"Empty Tin Can",1,"Item"},
diff --git a/DayZ/gui/gear/sidemenu_gear.lua b/DayZ/gui/gear/sidemenu_gear.lua
index 4ace1b2..6dc0b48 100644
--- a/DayZ/gui/gear/sidemenu_gear.lua
+++ b/DayZ/gui/gear/sidemenu_gear.lua
@@ -778,14 +778,15 @@ if ( keyState == "down" ) then
if itemName == "deadreason" then
local col = getElementData(getLocalPlayer(),"currentCol")
outputChatBox(getElementData(col,"deadreason"),255,255,255,true)
- --triggerServerEvent("onPlayerHideBody",col)
- --outputChatBox("You hid the body...",0,255,0,true)
- --disableMenu()
+ if getElementData(col,"killedBy") and getElementData(col,"killedBy") == localPlayer then
+ setElementData(localPlayer,"murders",getElementData(localPlayer,"murders")+1)
+ setElementData(col,"killedBy",nil)
+ end
return
end
if itemName == "petrolstation" then
local col = getElementData(getLocalPlayer(),"currentCol")
-
+
--Determine if the petrol station has any fuel left, otherwise tell the player. (1B0Y)
if (getElementData(col,"petrolQuantity") >= 1) then
setElementData(getLocalPlayer(),"Empty Gas Canister",getElementData(getLocalPlayer(),"Empty Gas Canister")-1)
diff --git a/DayZ/gui/spawnselection/spawnselection.png b/DayZ/gui/spawnselection/spawnselection.png
new file mode 100644
index 0000000..96d043a
Binary files /dev/null and b/DayZ/gui/spawnselection/spawnselection.png differ
diff --git a/DayZ/gui/status/misc/helmet.png b/DayZ/gui/status/misc/helmet.png
new file mode 100644
index 0000000..a856c17
Binary files /dev/null and b/DayZ/gui/status/misc/helmet.png differ
diff --git a/DayZ/gui/status/player_status.lua b/DayZ/gui/status/player_status.lua
index d107fd1..0de7e84 100644
--- a/DayZ/gui/status/player_status.lua
+++ b/DayZ/gui/status/player_status.lua
@@ -60,8 +60,16 @@ function updateStatusIcons()
dxDrawImage ( screenWidth*0.94 , screenHeight*0.63, screenHeight*0.065, screenHeight*0.065, ":DayZ/gui/status/misc/background.png",0,0,0)
dxDrawImage ( screenWidth*0.943 , screenHeight*0.63, screenHeight*0.055, screenHeight*0.055, ":DayZ/gui/status/humanity/"..h_number..".png",0,0,0)
]]
+ -- Helmet
+ if not gameplayVariables["newclothingsystem"] then
+ if getElementData(localPlayer,"hasHelmet") then
+ dxDrawImage ( screenWidth*0.94 , screenHeight*0.63, screenHeight*0.065, screenHeight*0.065, ":DayZ/gui/status/misc/background.png",0,0,0)
+ dxDrawImage ( screenWidth*0.943 , screenHeight*0.63, screenHeight*0.055, screenHeight*0.055, ":DayZ/gui/status/misc/helmet.png",0,0,0)
+ end
+ end
-- Temperature
local temperature = math.round(getElementData(localPlayer,"temperature"),2)
+ --local temperature = math.round(playerDynamicTable.playerTemperature,2)
local status = getElementData(localPlayer,"temperature_status") or 0
r,g,b = 0,255,0
local t_number = 3
@@ -89,6 +97,7 @@ function updateStatusIcons()
-- Thirst
r,g,b = 0,255,0
local thirst = getElementData(localPlayer,"thirst")
+ --local thirst = playerDynamicTable.playerWater
local thirst_coloring = getElementData(localPlayer,"thirst")*2.55
r,g,b = 255-thirst_coloring,thirst_coloring,0
local thirst_icon = ":DayZ/gui/status/thirst/100.png"
@@ -117,6 +126,7 @@ function updateStatusIcons()
-- Blood
r,g,b = 0,255,0
local blood = getElementData(localPlayer,"blood")
+ --local blood = playerDynamicTable.playerBlood
local blood_coloring = getElementData(localPlayer,"blood")/47.2
r,g,b = 255-blood_coloring,blood_coloring,0
local blood_icon = ":DayZ/gui/status/blood/12000.png"
@@ -139,6 +149,7 @@ function updateStatusIcons()
-- Food
r,g,b = 0,255,0
local food = getElementData(localPlayer,"food")
+ --local food = playerDynamicTable.playerFood
local food_coloring = getElementData(localPlayer,"food")*2.55
r,g,b = 255-food_coloring,food_coloring,0
local food_icon = ":DayZ/gui/status/hunger/100.png"
@@ -167,12 +178,15 @@ function updateStatusIcons()
-- // Status Symbols (Broken bone, pain, bleeding, ...)
-- Broken bone
if getElementData(localPlayer,"brokenbone") then
+ --if playerDynamicTable.playerBrokenBone then
dxDrawImage ( screenWidth*0.9375 , screenHeight*0.55, screenHeight*0.065, screenHeight*0.065, ":DayZ/gui/status/misc/brokenbone.png",0,0,0)
end
if getElementData(localPlayer,"bleeding") > 0 then
+ --if playerDynamicTable.playerBleeding > 0 then
dxDrawImage ( screenWidth*0.94 , screenHeight*0.85, screenHeight*0.065, screenHeight*0.065, ":DayZ/gui/status/misc/medic.png",0,0,0,tocolor(255,255,255,fading))
end
if getElementData(localPlayer,"infection") or getElementData(localPlayer,"sepsis") and getElementData(localPlayer,"sepsis") > 0 then
+ --if playerDynamicTable.playerInfection or playerDynamicTable.playerSepsis and playerDynamicTable.playerSepsis > 0 then
dxDrawImage ( screenWidth*0.94 , screenHeight*0.85, screenHeight*0.065, screenHeight*0.065, ":DayZ/gui/status/blood/infection.png",0,0,0)
end
local x,y,z = getElementPosition(localPlayer)
diff --git a/DayZ/handlers/houses/mapping/mapEditorScriptingExtension_c.lua b/DayZ/handlers/houses/mapping/mapEditorScriptingExtension_c.lua
deleted file mode 100644
index 6494661..0000000
--- a/DayZ/handlers/houses/mapping/mapEditorScriptingExtension_c.lua
+++ /dev/null
@@ -1,26 +0,0 @@
--- FILE: mapEditorScriptingExtension_c.lua
--- PURPOSE: Prevent the map editor feature set being limited by what MTA can load from a map file by adding a script file to maps
--- VERSION: RemoveWorldObjects (v1) AutoLOD (v1) BreakableObjects (v1)
-
-function requestLODsClient()
- triggerServerEvent("requestLODsClient", resourceRoot)
-end
-addEventHandler("onClientResourceStart", resourceRoot, requestLODsClient)
-
-function setLODsClient(lodTbl)
- for i, model in ipairs(lodTbl) do
- engineSetModelLODDistance(model, 300)
- end
-end
-addEvent("setLODsClient", true)
-addEventHandler("setLODsClient", resourceRoot, setLODsClient)
-
-function applyBreakableState()
- for k, obj in pairs(getElementsByType("object", resourceRoot)) do
- local breakable = getElementData(obj, "breakable")
- if breakable then
- setObjectBreakable(obj, breakable == "true")
- end
- end
-end
-addEventHandler("onClientResourceStart", resourceRoot, applyBreakableState)
\ No newline at end of file
diff --git a/DayZ/handlers/houses/mapping/mapEditorScriptingExtension_s.lua b/DayZ/handlers/houses/mapping/mapEditorScriptingExtension_s.lua
deleted file mode 100644
index c6ce942..0000000
--- a/DayZ/handlers/houses/mapping/mapEditorScriptingExtension_s.lua
+++ /dev/null
@@ -1,193 +0,0 @@
--- FILE: mapEditorScriptingExtension_s.lua
--- PURPOSE: Prevent the map editor feature set being limited by what MTA can load from a map file by adding a script file to maps
--- VERSION: RemoveWorldObjects (v1) AutoLOD (v1)
-
-local usedLODModels = {}
-
-function onResourceStartOrStop ( )
- for _, object in ipairs ( getElementsByType ( "removeWorldObject", source ) ) do
- local model = getElementData ( object, "model" )
- local lodModel = getElementData ( object, "lodModel" )
- local posX = getElementData ( object, "posX" )
- local posY = getElementData ( object, "posY" )
- local posZ = getElementData ( object, "posZ" )
- local interior = getElementData ( object, "interior" ) or 0
- local radius = getElementData ( object, "radius" )
- if ( eventName == "onResourceStart" ) then
- removeWorldModel ( model, radius, posX, posY, posZ, interior )
- removeWorldModel ( lodModel, radius, posX, posY, posZ, interior )
- else
- restoreWorldModel ( model, radius, posX, posY, posZ, interior )
- restoreWorldModel ( lodModel, radius, posX, posY, posZ, interior )
- end
- end
- if (eventName == "onResourceStart" and get(getResourceName(getThisResource())..".useLODs")) then
- for i, object in ipairs(getElementsByType("object", source)) do
- local objID = getElementModel(object)
- local lodModel = LOD_MAP[objID]
- if (lodModel) then
- local x,y,z = getElementPosition(object)
- local rx,ry,rz = getElementRotation(object)
- local lodObj = createObject(lodModel,x,y,z,rx,ry,rz,true)
- setElementInterior(lodObj, getElementInterior(object) )
- setElementDimension(lodObj, getElementDimension(object) )
- setElementParent(lodObj, object)
- setLowLODElement(object, lodObj)
- table.insert(usedLODModels, lodModel)
- end
- end
- end
-end
-addEventHandler ( "onResourceStart", resourceRoot, onResourceStartOrStop )
-addEventHandler ( "onResourceStop", resourceRoot, onResourceStartOrStop )
-
-function receiveLODsClientRequest()
- triggerClientEvent(client, "setLODsClient", resourceRoot, usedLODModels)
-end
-addEvent("requestLODsClient", true)
-addEventHandler("requestLODsClient", resourceRoot, receiveLODsClientRequest)
-
--- MTA LOD Table [object] = [lodmodel]
-LOD_MAP = { [17697] = 17768;
-[8476] = 8905; [9476] = 9263; [4339] = 4472; [8654] = 8751; [7465] = 7795; [8465] = 8744; [11114] = 11052; [13872] = 13884; [6999] = 7120;
-[7999] = 8098; [6959] = 7343; [9733] = 9644; [10927] = 11356; [10759] = 10804; [8445] = 8478; [7445] = 7761; [10928] = 11065; [9266] = 9475; [13676] = 13870;
-[8554] = 8804; [5745] = 5827; [10855] = 11187; [4813] = 4903; [8439] = 8910; [7439] = 7757; [7043] = 7059; [8043] = 8111; [9043] = 9134; [10384] = 10548;
-[9745] = 9873; [4833] = 4943; [6979] = 7006; [13692] = 13766; [7454] = 7784; [8454] = 8599; [11132] = 11208; [10843] = 10892; [8513] = 8820; [13732] = 13770;
-[9139] = 9145; [10903] = 10907; [5759] = 5917; [8343] = 8363; [10948] = 11021; [4303] = 4437; [9215] = 9460; [8533] = 8817; [17671] = 17788; [9303] = 9372;
-[4533] = 4532; [8625] = 8794; [4244] = 4379; [9613] = 9875; [13739] = 13772; [5145] = 5235; [10793] = 11330; [9899] = 9635; [4315] = 4449; [7315] = 7316;
-[6315] = 6424; [9315] = 9375; [10833] = 10896; [4243] = 4378; [7633] = 7764; [8633] = 8802; [8244] = 8024; [13715] = 13782; [8525] = 8902; [5166] = 5336;
-[4344] = 4477; [10823] = 11248; [4335] = 4468; [10559] = 10724; [9065] = 9068; [5123] = 5213; [9705] = 9772; [5028] = 5029; [9028] = 9179; [10763] = 10884;
-[7045] = 7063; [8045] = 8011; [4165] = 4166; [8512] = 8759; [8344] = 8364; [8543] = 8604; [9039] = 9040; [6879] = 6891; [4879] = 4921; [4345] = 4478;
-[9223] = 9406; [10939] = 11370; [8868] = 9085; [10758] = 10923; [4868] = 5045; [9345] = 9377; [11255] = 11262; [8212] = 8220; [6065] = 6082; [7443] = 7859;
-[8443] = 8914; [13672] = 13832; [13741] = 13765; [10870] = 11204; [4366] = 4496; [4245] = 4380; [9579] = 9626; [8611] = 8917; [8245] = 8025; [10861] = 11169;
-[10352] = 10715; [4365] = 4529; [9743] = 9872; [9066] = 9067; [13784] = 13836; [5679] = 5680; [11254] = 11268; [9235] = 9450; [5805] = 5912; [9711] = 9774;
-[13752] = 13876; [8627] = 8968; [11120] = 11196; [9026] = 9178; [9232] = 9359; [10018] = 10170; [10601] = 10730; [10795] = 11329; [7368] = 7376; [8368] = 8367;
-[10983] = 11143; [10752] = 11355; [13726] = 13786; [13730] = 13844; [13801] = 13880; [7320] = 7322; [4320] = 4454; [5021] = 5022; [9021] = 9181; [4286] = 4420;
-[5109] = 5193; [8468] = 8972; [4299] = 4433; [9286] = 9464; [9299] = 9374; [8501] = 9075; [10817] = 10877; [6501] = 6504; [10959] = 10963; [10905] = 10908;
-[7420] = 7812; [8420] = 9063; [7321] = 7323; [4321] = 4455; [11299] = 11298; [4847] = 4933; [10492] = 10729; [4295] = 4429; [11332] = 11333; [9928] = 10002;
-[9001] = 9010; [5034] = 5035; [8034] = 8126; [17524] = 17730; [6488] = 6492; [8520] = 8829; [9488] = 9780; [10932] = 11217; [7947] = 7948; [11130] = 11207;
-[4268] = 4402; [7099] = 7112; [7459] = 7789; [8459] = 8767; [11337] = 11358; [4267] = 4401; [11256] = 11264; [9267] = 9477; [13707] = 13839; [8588] = 8786;
-[11098] = 11177; [7559] = 7743; [10753] = 11206; [10867] = 11185; [4367] = 4497; [7367] = 7372; [8288] = 8289; [11303] = 11304; [17606] = 17718; [10941] = 11167;
-[13795] = 13796; [4828] = 4942; [4259] = 4393; [11006] = 11151; [7101] = 7142; [9006] = 9015; [17535] = 17970; [7388] = 7285; [7539] = 7959; [8539] = 8790;
-[13820] = 13822; [6913] = 7178; [9487] = 9640; [11126] = 11212; [11125] = 10802; [6888] = 7138; [10864] = 11407; [5859] = 5903; [8587] = 8788; [9587] = 9621;
-[8628] = 8799; [11121] = 11068; [11138] = 11198; [8859] = 8861; [9616] = 9887; [8616] = 8974; [13718] = 13888; [7992] = 8022; [13826] = 13830; [9137] = 9143;
-[4822] = 4980; [8137] = 8197; [5137] = 5195; [6948] = 7005; [5472] = 5564; [8377] = 8021; [7636] = 7724; [10966] = 11050; [8472] = 8912; [9690] = 9686;
-[9919] = 9937; [13810] = 13812; [7417] = 7726; [4294] = 4428; [4851] = 4902; [10489] = 10602; [9256] = 9393; [5871] = 5970; [13736] = 13778; [8256] = 8257;
-[4831] = 4950; [9597] = 9844; [4256] = 4390; [7536] = 7821; [6951] = 7002; [6991] = 7176; [10936] = 11158; [7991] = 8088; [3992] = 4037; [4991] = 5012;
-[3991] = 4043; [5752] = 5833; [13678] = 13853; [9571] = 9650; [13716] = 13833; [7730] = 7780; [5748] = 5907; [9730] = 9792; [17686] = 17914; [7604] = 7808;
-[13733] = 13780; [13682] = 13868; [9836] = 9841; [9490] = 9809; [8490] = 8703; [8217] = 8223; [9719] = 9779; [9217] = 9449; [6217] = 6086; [10766] = 10880;
-[9716] = 9773; [5504] = 5548; [4363] = 4494; [9037] = 9038; [8037] = 8103; [10904] = 10906; [8677] = 8752; [10408] = 10689; [9351] = 9421; [13813] = 13815;
-[13717] = 13785; [8351] = 8347; [7557] = 7816; [7602] = 7810; [7317] = 7318; [4351] = 4483; [6952] = 7003; [4317] = 4451; [7263] = 7279; [13680] = 13869;
-[8352] = 8359; [4263] = 4397; [10930] = 11054; [4331] = 4465; [4872] = 4924; [8521] = 8830; [9216] = 9457; [11351] = 11222; [11288] = 10895; [6324] = 6380;
-[4897] = 4905; [6897] = 6902; [8451] = 8973; [7451] = 7815; [4884] = 5054; [6884] = 6896; [6236] = 6240; [9236] = 9402; [4324] = 4458; [9304] = 9376;
-[13723] = 13819; [7470] = 7799; [8630] = 8798; [7452] = 7794; [8452] = 8606; [8421] = 8692; [7421] = 7809; [8380] = 8381; [10940] = 11191; [13742] = 13764;
-[11363] = 11398; [7591] = 7830; [9224] = 9394; [9551] = 9883; [9083] = 9084; [7997] = 8362; [4352] = 4484; [17597] = 17837; [10362] = 10325; [11113] = 11197;
-[5117] = 5194; [9136] = 9142; [9330] = 9432; [4330] = 4464; [9552] = 9884; [8552] = 8763; [8531] = 8775; [7337] = 7338; [4664] = 4665; [9337] = 9433;
-[5156] = 5162; [4156] = 4157; [4337] = 4470; [10363] = 10326; [7651] = 7699; [4890] = 4946; [8857] = 8862; [9617] = 9888; [17683] = 17720; [9492] = 9794;
-[13882] = 13842; [9652] = 9799; [8631] = 8800; [7631] = 7744; [13713] = 13843; [8056] = 8028; [4316] = 4375; [4296] = 4430; [10769] = 10894; [13691] = 13745;
-[9316] = 9428; [11104] = 11341; [7990] = 8015; [4283] = 4417; [10751] = 10798; [10934] = 11219; [4990] = 5010; [4336] = 4469; [9957] = 9972; [10151] = 10161;
-[6301] = 6500; [4301] = 4435; [4371] = 4501; [8148] = 8273; [5148] = 5359; [4242] = 4377; [7242] = 7140; [9022] = 9182; [9242] = 9401; [4282] = 4416;
-[7464] = 7782; [8040] = 8104; [7371] = 7373; [8464] = 9157; [5119] = 5245; [7450] = 7814; [8450] = 8479; [10969] = 11166; [17677] = 17908; [7484] = 7773;
-[11107] = 11108; [9484] = 9869; [10407] = 10688; [8091] = 8101; [13709] = 13835; [7248] = 7256; [8382] = 8384; [4585] = 4626; [4248] = 4383; [6122] = 6182;
-[11342] = 11344; [7963] = 7964; [4332] = 4466; [10418] = 10727; [9071] = 9073; [10819] = 10881; [7071] = 7183; [8071] = 8106; [4262] = 4396; [10294] = 10299;
-[4550] = 4561; [11287] = 11286; [5151] = 5241; [9585] = 9619; [6188] = 6190; [5188] = 5240; [13690] = 13773; [9219] = 9452; [8219] = 8222; [4843] = 4931;
-[4131] = 4132; [4885] = 5053; [7042] = 7066; [4260] = 4394; [7863] = 7876; [8240] = 8241; [10017] = 9989; [10945] = 11016; [8586] = 8789; [4863] = 4934;
-[10562] = 10598; [6280] = 6437; [4291] = 4425; [7251] = 7259; [7432] = 7738; [13751] = 13781; [9260] = 9380; [4297] = 4431; [9291] = 9447; [7048] = 7107;
-[9248] = 9408; [11077] = 11058; [4271] = 4405; [10087] = 10168; [4322] = 4456; [5160] = 5335; [9231] = 9363; [9140] = 9146; [4168] = 4169; [8446] = 8605;
-[9486] = 9641; [10351] = 10719; [8486] = 8749; [4280] = 4414; [8350] = 8358; [8532] = 8771; [4240] = 4450; [4350] = 4482; [9683] = 9866; [7984] = 8124;
-[6984] = 7282; [10957] = 11378; [11229] = 11216; [8391] = 8696; [10066] = 10090; [4845] = 4914; [11115] = 11171; [7548] = 7774; [11367] = 11368; [7864] = 7875;
-[6864] = 6870; [7865] = 7874; [13677] = 13867; [13710] = 13840; [8610] = 8918; [7632] = 7745; [8632] = 8801; [8850] = 8965; [8519] = 8897; [8983] = 9018;
-[8845] = 8848; [6983] = 7283; [7983] = 8107; [6916] = 7225; [9954] = 10106; [8079] = 8110; [4563] = 4566; [11012] = 11270; [5115] = 5252; [5002] = 4939;
-[9115] = 9161; [10638] = 10640; [4883] = 4929; [10491] = 10725; [6883] = 7114; [7854] = 7853; [17685] = 17742; [4854] = 5050; [4348] = 4480; [10971] = 11064;
-[9946] = 10257; [4810] = 4915; [4832] = 4948; [7463] = 7793; [7057] = 7126; [4319] = 4453; [7383] = 7384; [8383] = 8385; [4852] = 4918; [7485] = 7776;
-[11345] = 11346; [7852] = 7851; [11080] = 11178; [4846] = 4953; [7448] = 7817; [10938] = 11144; [13757] = 13881; [11137] = 11203; [7965] = 7966; [5003] = 4956;
-[10694] = 10728; [9584] = 9620; [8584] = 8732; [7584] = 7716; [9348] = 9429; [8824] = 8903; [8003] = 8092; [10028] = 9967; [7475] = 7804; [11252] = 11267;
-[8475] = 8915; [8678] = 8777; [4835] = 4941; [4349] = 4481; [11135] = 11200; [11111] = 11175; [10955] = 11397; [8523] = 8900; [10386] = 10731; [13673] = 13850;
-[7444] = 7873; [8444] = 8908; [9735] = 9802; [7969] = 7970; [10840] = 10912; [7449] = 7813; [8449] = 8907; [4869] = 4954; [8466] = 8745; [6869] = 6995;
-[5744] = 5826; [9744] = 9871; [10943] = 11142; [4275] = 4409; [9174] = 8831; [13693] = 13774; [7174] = 7366; [10083] = 10169; [6878] = 6890; [17607] = 17810;
-[9723] = 9781; [8149] = 8274; [13738] = 13771; [9858] = 9811; [8858] = 8864; [7433] = 7740; [11083] = 11153; [4249] = 4384; [4535] = 4536; [9901] = 9963;
-[11134] = 11278; [7249] = 7257; [10405] = 10687; [5801] = 5828; [4666] = 4667; [7544] = 7752; [8544] = 8739; [11117] = 11069; [8422] = 8693; [11116] = 11053;
-[9601] = 9807; [6989] = 6906; [4374] = 4503; [9225] = 9409; [5313] = 5316; [4313] = 4447; [9313] = 9396; [8313] = 8316; [4302] = 4436; [6054] = 6177;
-[7054] = 7339; [8054] = 8018; [9721] = 9638; [6233] = 6242; [4233] = 4234; [8433] = 8736; [7603] = 7807; [10917] = 10918; [3689] = 3690; [4325] = 4459;
-[9715] = 9776; [10942] = 11168; [8154] = 8279; [9689] = 9687; [8049] = 8026; [11127] = 11180; [5333] = 5334; [4333] = 4467; [9205] = 9358; [8133] = 8144;
-[13756] = 13879; [10354] = 10332; [6502] = 6506; [11343] = 11357; [9615] = 9658; [7254] = 7262; [10359] = 10692; [9276] = 9453; [4305] = 4439; [4254] = 4388;
-[5033] = 5055; [11123] = 11192; [10929] = 11055; [9233] = 9356; [10767] = 10879; [3489] = 3490; [11118] = 11194; [4274] = 4408; [6213] = 6206; [8213] = 8224;
-[9213] = 9455; [9489] = 9782; [8489] = 8700; [8515] = 8754; [4354] = 4486; [5176] = 5237; [9703] = 9785; [7967] = 7968; [9004] = 9013; [7950] = 7949;
-[7945] = 7946; [8004] = 8161; [5004] = 5008; [7938] = 7937; [7889] = 7890; [10365] = 10328; [7882] = 7883; [7324] = 7325; [7880] = 7887; [7868] = 7870;
-[7867] = 7871; [7866] = 7872; [7849] = 7850; [7011] = 7121; [10852] = 11186; [7755] = 7856; [7731] = 7781; [7729] = 7779; [7661] = 7723; [7660] = 7721;
-[7650] = 7700; [11283] = 11361; [7635] = 7725; [9210] = 9465; [8210] = 8272; [7634] = 7775; [7630] = 7722; [7629] = 7777; [7616] = 7728; [4310] = 4444;
-[7605] = 7739; [7601] = 7811; [7600] = 7806; [7593] = 7831; [7592] = 7828; [7585] = 7594; [13825] = 13829; [7579] = 7825; [7558] = 7742; [7555] = 7668;
-[7553] = 7824; [4289] = 4423; [7552] = 7749; [7551] = 7750; [9289] = 9454; [7550] = 7751; [4288] = 4422; [7547] = 7748; [7546] = 7732; [7545] = 7747;
-[17675] = 17811; [7537] = 7822; [13684] = 13776; [7486] = 7869; [10859] = 10803; [7483] = 7772; [8517] = 8898; [7482] = 7771; [7481] = 7770; [7480] = 7769;
-[7479] = 7768; [8039] = 8100; [8172] = 8094; [7476] = 7765; [7474] = 7803; [4247] = 4382; [7472] = 7801; [7471] = 7800; [8128] = 8129; [7468] = 7888;
-[6957] = 7293; [7466] = 7796; [5314] = 5315; [9064] = 9069; [7460] = 7790; [8002] = 8142; [13702] = 13885; [11258] = 11265; [9211] = 9466; [7457] = 7787;
-[9722] = 9783; [7455] = 7785; [7453] = 7783; [9036] = 9147; [8036] = 8102; [10413] = 10330; [7447] = 7763; [7446] = 7762; [7442] = 7760; [7441] = 7759;
-[7440] = 7758; [7438] = 7756; [7437] = 7754; [7436] = 7858; [7435] = 7746; [10958] = 11201; [7431] = 7737; [10935] = 11220; [7430] = 7736; [7429] = 7735;
-[7428] = 7734; [9246] = 9403; [7424] = 7702; [7422] = 7805; [7419] = 7487; [11105] = 11213; [7416] = 7727; [8378] = 8379; [9057] = 9061; [8356] = 8105;
-[6974] = 7113; [6915] = 7181; [8354] = 8348; [8353] = 8365; [11097] = 11157; [8333] = 8280; [8315] = 8318; [11230] = 11276; [8314] = 8317; [8311] = 8312;
-[5795] = 5921; [13821] = 13849; [7051] = 7060; [8510] = 8760; [8305] = 8304; [8469] = 8747; [11073] = 11172; [8300] = 8301; [10815] = 11373; [8283] = 8284;
-[8480] = 8690; [6900] = 6901; [8263] = 8267; [4278] = 4412; [8262] = 8270; [8260] = 8261; [9553] = 9845; [4285] = 4419; [5749] = 5918; [8254] = 8113;
-[11364] = 11141; [8498] = 8705; [8246] = 8031; [10967] = 11066; [8236] = 8238; [8232] = 8233; [8228] = 8234; [4292] = 4426; [11071] = 11173; [8216] = 8227;
-[10792] = 11218; [4258] = 4392; [8215] = 8226; [17673] = 17787; [4369] = 4499; [6871] = 7122; [9234] = 9397; [8202] = 8203; [10403] = 10690; [8201] = 8239;
-[10865] = 11325; [6917] = 7180; [8200] = 8205; [8199] = 8204; [9000] = 9009; [10794] = 11331; [8186] = 8191; [7477] = 7766; [8477] = 8602; [13720] = 13837;
-[4849] = 5018; [8171] = 8361; [7998] = 8095; [8165] = 8266; [8155] = 8276; [11095] = 11350; [9056] = 9060; [8152] = 8278; [8151] = 8268; [8150] = 8275;
-[8147] = 8271; [4357] = 4488; [4358] = 4489; [8136] = 8138; [8135] = 8140; [8357] = 8360; [7469] = 7798; [11075] = 11062; [8080] = 8096; [8072] = 8143;
-[11088] = 11282; [8070] = 8141; [10946] = 11403; [13887] = 13788; [8052] = 8017; [8051] = 8032; [4266] = 4400; [8048] = 8020; [4328] = 4462; [8046] = 8019;
-[7478] = 7767; [8577] = 8743; [7549] = 7753; [10863] = 10922; [8035] = 8112; [6094] = 6144; [9094] = 9096; [11072] = 11061; [11260] = 11266; [11335] = 11109;
-[6130] = 6255; [8010] = 8090; [8009] = 8030; [8008] = 8296; [4304] = 4438; [8006] = 8211; [8005] = 8097; [8458] = 8598; [7458] = 7788; [8001] = 8093;
-[8585] = 8733; [7996] = 8099; [7995] = 8029; [9732] = 9791; [17676] = 17727; [7989] = 8014; [7988] = 8089; [7987] = 8109; [7985] = 8258; [7978] = 8108;
-[10860] = 10805; [7370] = 7374; [7369] = 7375; [7364] = 7365; [7362] = 7363; [9578] = 9627; [8398] = 8778; [10364] = 10327; [7359] = 7360; [7357] = 7358;
-[11122] = 11193; [6981] = 7281; [9302] = 9371; [7347] = 7346; [7336] = 7119; [7335] = 7341; [4276] = 4410; [7327] = 7328; [9062] = 8773; [7881] = 7855;
-[6881] = 6892; [4269] = 4403; [6899] = 6904; [7098] = 7152; [7253] = 7261; [9710] = 9806; [8448] = 8906; [11128] = 11349; [7203] = 6895; [10230] = 10141;
-[9173] = 8750; [4840] = 4911; [13818] = 13886; [7240] = 7241; [7220] = 7182; [7218] = 7136; [7217] = 7130; [9929] = 10251; [8609] = 8919; [10854] = 11188;
-[7247] = 7255; [4364] = 4495; [7192] = 7194; [7191] = 7195; [8634] = 8967; [4346] = 4531; [4293] = 4427; [7100] = 7143; [11003] = 11057; [13683] = 13859;
-[9725] = 9646; [9949] = 9964; [4253] = 4530; [9708] = 9810; [7056] = 7125; [7055] = 7116; [7053] = 7067; [4306] = 4440; [4841] = 4959; [8461] = 8766;
-[9306] = 9398; [8306] = 8307; [8629] = 8796; [7049] = 7108; [6880] = 7106; [9254] = 9364; [7044] = 7168; [10926] = 11165; [10937] = 11067; [7036] = 7137;
-[7022] = 7193; [4355] = 4534; [5355] = 5356; [7013] = 7348; [6990] = 7008; [8612] = 8779; [4246] = 4381; [5347] = 5348; [6988] = 6992; [9726] = 9867;
-[9900] = 9936; [6982] = 7284; [7355] = 7356; [8355] = 8349; [6971] = 7174; [8860] = 8863; [7467] = 7797; [6956] = 7110; [7427] = 7733; [6950] = 7001;
-[9002] = 9011; [9206] = 9467; [6945] = 7109; [8467] = 8753; [4834] = 4922; [9264] = 9474; [13689] = 13856; [8460] = 8756; [17944] = 17945; [6912] = 7177;
-[8264] = 8265; [7264] = 7278; [5882] = 5884; [6882] = 6894; [6898] = 6903; [10965] = 11051; [6886] = 6911; [6885] = 7007; [6887] = 6893; [4842] = 4932;
-[8053] = 8016; [8626] = 8797; [17678] = 17707; [11100] = 11183; [8255] = 8159; [7047] = 7061; [8047] = 8013; [9255] = 9392; [10849] = 10853; [5143] = 5242;
-[8672] = 8768; [9117] = 9148; [4284] = 4418; [4862] = 4935; [6877] = 6889; [6876] = 7135; [10454] = 10732; [10818] = 10876; [9214] = 9463; [8214] = 8225;
-[6867] = 6939; [4340] = 4473; [9709] = 9805; [13703] = 13857; [10871] = 10902; [11302] = 11309; [4264] = 4398; [9261] = 9400; [4314] = 4448; [5147] = 5263;
-[6863] = 6927; [9119] = 9155; [13823] = 13827; [9284] = 9469; [7353] = 7354; [13737] = 13767; [5353] = 5354; [8542] = 8785; [5995] = 5997; [4353] = 4485;
-[4341] = 4474; [9116] = 9156; [10961] = 10964; [9265] = 9473; [7514] = 7680; [8514] = 8776; [17582] = 17745; [6227] = 6244; [8440] = 8920; [13711] = 13883;
-[5758] = 5915; [13814] = 13787; [10768] = 10882; [7064] = 7068; [10933] = 11216; [8562] = 8784; [9135] = 9141; [11106] = 11336; [8932] = 8933; [8411] = 8413;
-[17594] = 17759; [8209] = 8269; [11005] = 11161; [10821] = 11250; [13816] = 13877; [9581] = 9629; [17670] = 17786; [6234] = 6241; [13824] = 13828; [9095] = 9097;
-[8055] = 8027; [4360] = 4491; [4343] = 4476; [10848] = 11190; [10777] = 11375; [4312] = 4446; [9082] = 8949; [10778] = 11227; [9727] = 9789; [9076] = 9077;
-[9072] = 8694; [8485] = 8699; [7580] = 7778; [9706] = 9803; [9580] = 9628; [10305] = 10304; [7461] = 7791; [4540] = 4541; [5747] = 5908; [4326] = 4460;
-[4361] = 4492; [4342] = 4475; [10822] = 11251; [9243] = 9378; [7326] = 7329; [9249] = 9451; [8134] = 8139; [8153] = 8277; [13706] = 13838; [10956] = 11377;
-[9342] = 9471; [3755] = 3756; [9042] = 9158; [8342] = 8366; [13719] = 13841; [4362] = 4493; [4827] = 4960; [9090] = 9091; [9714] = 9775; [4287] = 4421;
-[10301] = 10302; [17684] = 17721; [9024] = 9183; [9023] = 9180; [5807] = 5910; [8522] = 8899; [4298] = 4432; [4373] = 4537; [4020] = 4061; [5105] = 5246;
-[9908] = 9970; [8447] = 8601; [13871] = 13873; [8655] = 8762; [7186] = 7185; [9712] = 9800; [11124] = 11189; [9226] = 9470; [7434] = 7741; [11131] = 10800;
-[8482] = 8691; [3814] = 3815; [9287] = 9461; [9003] = 9012; [8442] = 8909; [10353] = 10331; [6949] = 7000; [8198] = 8298; [9120] = 9160; [8882] = 8924;
-[9212] = 9456; [8867] = 8950; [4334] = 4528; [9614] = 9662; [9570] = 9796; [4323] = 4457; [9251] = 9355; [4829] = 4951; [4273] = 4407; [7462] = 7792;
-[8710] = 8711; [11094] = 11152; [4309] = 4443; [7046] = 7062; [8511] = 8761; [5046] = 5047; [8671] = 8769; [8664] = 8755; [5276] = 5284; [8547] = 8742;
-[8663] = 8704; [7334] = 7340; [9582] = 9755; [10816] = 10878; [5134] = 5321; [4809] = 4904; [10834] = 10899; [8637] = 8772; [8050] = 8012; [9290] = 9448;
-[8462] = 8757; [7050] = 7065; [6290] = 6505; [10862] = 11159; [8290] = 8291; [10451] = 10726; [10931] = 11221; [8624] = 8793; [10295] = 10298; [8622] = 8780;
-[9493] = 9636; [4265] = 4399; [9530] = 9843; [7069] = 7070; [8000] = 8164; [8455] = 8894; [17674] = 17800; [8583] = 8731; [8582] = 8730; [11084] = 11170;
-[8564] = 8803; [4368] = 4498; [8561] = 8783; [5112] = 5255; [4129] = 4130; [8555] = 8709; [8553] = 8764; [11074] = 11056; [4261] = 4395; [4327] = 4461;
-[8541] = 8787; [8394] = 8823; [6873] = 6918; [8540] = 8791; [9222] = 9360; [8033] = 8346; [8524] = 8901; [9138] = 9144; [4281] = 4415; [5746] = 5830;
-[10962] = 11338; [5860] = 5920; [10820] = 11249; [7041] = 7058; [8499] = 8929; [8497] = 8748; [4279] = 4413; [9070] = 9074; [17672] = 17789; [10866] = 11184;
-[8281] = 8282; [9118] = 9149; [8474] = 8916; [8471] = 8600; [8470] = 8746; [5118] = 5209; [8463] = 8765; [10960] = 11415; [4230] = 4229; [7052] = 7129;
-[6914] = 7179; [8453] = 8603; [8457] = 8904; [7250] = 7258; [9301] = 9373; [9250] = 9354; [10036] = 10272; [8441] = 8895; [9600] = 9643; [9262] = 9472;
-[9285] = 9462; [9025] = 9177; [10954] = 11049; [10409] = 10495; [9591] = 9784; [10851] = 10909; [4250] = 4385; [5250] = 5251; [8392] = 8698; [10027] = 9939;
-[4257] = 4391; [13735] = 13779; [13845] = 13847; [5038] = 5039; [8393] = 8697; [8396] = 8708; [8038] = 8125; [4370] = 4500; [13708] = 13834; [8390] = 8695;
-[9288] = 9458; [10869] = 11181; [9747] = 9651; [13740] = 13750; [9736] = 9637; [7994] = 8297; [9150] = 9151; [5994] = 5996; [9731] = 9790; [9338] = 9399;
-[11139] = 11160; [10300] = 10303; [13674] = 13848; [10756] = 10924; [13789] = 13851; [9724] = 9788; [4241] = 4376; [7456] = 7786; [4338] = 4471; [9269] = 9478;
-[4870] = 4944; [9300] = 9370; [8456] = 8758; [11112] = 11063; [11129] = 11348; [10857] = 11205; [7993] = 8023; [5270] = 5281; [4252] = 4387; [9208] = 9446;
-[4300] = 4434; [9005] = 9014; [4318] = 4452; [9252] = 9357; [4307] = 4441; [7252] = 7260; [11297] = 11300; [9602] = 9648; [10755] = 10883; [4359] = 4490;
-[9696] = 9695; [10850] = 10919; [13698] = 13763; [13675] = 13852; [11136] = 11202; [5296] = 5307; [4875] = 4916; [8438] = 8770; [9693] = 9691; [9685] = 9684;
-[9609] = 9877; [5146] = 5236; [4277] = 4411; [4653] = 4655; [9207] = 9468; [11306] = 11310; [9653] = 9654; [4308] = 4442; [9593] = 9813; [5754] = 5909;
-[8844] = 8847; [8308] = 8309; [13704] = 13846; [11253] = 11263; [4844] = 4957; [8189] = 8193; [10771] = 10901; [4207] = 4036; [9729] = 9787; [10296] = 10297;
-[4838] = 4940; [9491] = 9645; [4356] = 4487; [8473] = 8913; [7473] = 7802; [11365] = 11366; [11362] = 11399; [4538] = 4539; [9720] = 9639; [11010] = 11048;
-[5767] = 5964; [8538] = 8792; [11326] = 11328; [11308] = 11307; [4866] = 4937; [6953] = 7004; [6866] = 7139; [5866] = 5880; [6507] = 6512; [5757] = 5914;
-[4255] = 4389; [11133] = 11210; [5802] = 5832; [11119] = 11195; [10385] = 10721; [9008] = 9017; [4107] = 4035; [5107] = 5365; [5106] = 5264; [8518] = 8896;
-[5862] = 5923; [9694] = 9692; [11096] = 11211; [11079] = 11059; [4820] = 4952; [11078] = 11070; [13700] = 13775; [10788] = 11369; [11076] = 11176; [5756] = 5913;
-[9209] = 9459; [10970] = 11174; [8638] = 8911; [9027] = 9176; [4272] = 4406; [5796] = 5922; [9007] = 9016; [8007] = 8295; [9907] = 9935; [4311] = 4445;
-[9218] = 9445; [6048] = 6131; [5108] = 5211; [5861] = 5899; [4329] = 4463; [6292] = 6503; [10858] = 11179; [8218] = 8221; [13686] = 13769; [4867] = 4938;
-[3816] = 3817; [5009] = 4955; [10868] = 11182; [13688] = 13854; [9529] = 9531; [8529] = 8774; [5797] = 5925; [10404] = 10577; [10791] = 10801; [10790] = 11209;
-[4290] = 4424; [4251] = 4386; [5167] = 5159; [13809] = 13811; [10750] = 10799; [4270] = 4404; [10453] = 10733; [4372] = 4502; [9707] = 9804; [5753] = 5834;
-[10387] = 10329; [6229] = 6246; [5707] = 5905; [13685] = 13858; [5297] = 5320; [4163] = 4164; [10968] = 11199; [13734] = 13768; [3707] = 3708; [6189] = 6191;
-[9718] = 9778; [4865] = 4936; [9608] = 9657; [6944] = 7111;
-}
diff --git a/DayZ/handlers/houses/mapping/mapping.map b/DayZ/handlers/houses/mapping/mapping.map
deleted file mode 100644
index 82caada..0000000
--- a/DayZ/handlers/houses/mapping/mapping.map
+++ /dev/null
@@ -1,86 +0,0 @@
-
diff --git a/DayZ/handlers/houses/teleporteditor/edf_cl.lua b/DayZ/handlers/houses/teleporteditor/edf_cl.lua
deleted file mode 100644
index 69ca71c..0000000
--- a/DayZ/handlers/houses/teleporteditor/edf_cl.lua
+++ /dev/null
@@ -1,269 +0,0 @@
-addEvent("onClientElementCreate",true)
-addEvent("onClientElementSelect",true)
-addEvent("onClientElementDrop",true)
-addEvent("onClientElementDestroyed",true)
-addEvent("onClientElementPropertyChanged",true)
-local isSlelcted = {}
-local isDestroyed ={}
-local lastSelected
-local lastcreated
-local text = "Do you want to set ... as a destination for last selected marker (...)"
-local window = guiCreateWindow(200,100,224,154,"teleporteditor",false)
-guiWindowSetSizable(window,false)
-local memo = guiCreateMemo(9,21,206,83,text,false,window)
-guiMemoSetReadOnly(memo,true)
-local yesb = guiCreateButton(13,111,82,33,"yes (1)",false,window)
-local nob = guiCreateButton(133,111,82,33,"no (2)",false,window)
-guiSetVisible(window, false)
-addEventHandler("onClientElementPropertyChanged",getRootElement(),function ( propertyName )
- --outputChatBox("change "..propertyName)
- if getElementType(source) == "Teleport_p" and (propertyName == "interior_") then
- --outputChatBox("teleport ok")
- --local dim = exports.edf:edfGetElementProperty(source, "dimension_")
- local int = exports.edf:edfGetElementProperty(source, "interior_")
- --exports.edf:edfSetElementDimension (source, dim)
- --exports.edf:edfSetElementInterior (source, int)
- triggerServerEvent("onchangei",getLocalPlayer(),source,int)
- elseif getElementType(source) == "destination_p" and (propertyName == "t_interior") then
- --outputChatBox("destyn ok")
- --local dim = exports.edf:edfGetElementProperty(source, "t_dimension")
- local int = exports.edf:edfGetElementProperty(source, "t_interior")
- --exports.edf:edfSetElementDimension (source, dim)
- --exports.edf:edfSetElementInterior (source, int)
- triggerServerEvent("onchangei",getLocalPlayer(),source,int)
- end
-end)
-addEventHandler ( "onClientElementCreate", getRootElement(),function()
- if getElementType(source) == "Teleport_p" then
- local elid = tostring(getElementID(source)) or "error"
- exports.edf:edfSetElementProperty (source, "description", elid)
- end
- if getElementType(source) == "Teleport_p" or getElementType(source) == "destination_p" then
- --local dim = getElementDimension(getLocalPlayer())
- local int = getElementInterior(getLocalPlayer())
- --exports.edf:edfSetElementDimension (source, dim)
- --exports.edf:edfSetElementInterior (source, int)
- triggerServerEvent("onchangei",getLocalPlayer(),source,int)
- if getElementType(source) == "Teleport_p" then
- --exports.edf:edfSetElementProperty (source, "dimension_", dim)
- exports.edf:edfSetElementProperty (source, "interior_", int)
- elseif getElementType(source) == "destination_p" then
- --exports.edf:edfSetElementProperty (source, "t_dimension", dim)
- exports.edf:edfSetElementProperty (source, "t_interior", int)
- end
- end
-end)
-addEventHandler ( "onClientElementSelect", getRootElement(),function()
- --outputChatBox(getElementType(getElementParent(source)))
- if getElementType(getElementParent(source)) == "Teleport_p" or getElementType(getElementParent(source)) == "destination_p" then
- --outputChatBox("?????")
- isSlelcted[getElementParent(source)] = true
- elseif getElementType(source) == "Teleport_p" or getElementType(source) == "destination_p" then
- isSlelcted[source] = true
- end
- if getElementType(getElementParent(source)) == "Teleport_p" then
- closewindow()
- elseif getElementType(source) == "Teleport_p" then
- closewindow()
- end
- if getElementType(getElementParent(source)) == "destination_p" then
- setTimer(asign,1000,1,getElementParent(source))
- elseif getElementType(source) == "destination_p" then
- setTimer(asign,1000,1,source)
- end
-end)
-function asign(element)
- if getElementType(element) == "destination_p" and lastSelected and isElement(lastSelected) then
- local targetid = exports.edf:edfGetElementProperty (lastSelected, "destynation_id")
- if not isElement(targetid) then
- lastcreated = element
- text = "Do you want to set "..tostring(getElementID(element)).." as a destination for last selected teleport ("..tostring(getElementID(lastSelected))..")?"
- guiSetText(memo,text)
- guiSetVisible(window, true)
- bindKey("1","down",yesfunc)
- bindKey("num_1","down",yesfunc)
- bindKey("2","down",nofunc)
- bindKey("num_2","down",nofunc)
- end
- end
-end
-function yesfunc()
- closewindow()
- exports.edf:edfSetElementProperty (lastSelected, "destynation_id", lastcreated)
-end
-function nofunc()
- closewindow()
-end
-addEventHandler ( "onClientGUIClick", yesb, yesfunc, false )
-addEventHandler ( "onClientGUIClick", nob, nofunc, false )
-function closewindow()
- guiSetVisible(window, false)
- unbindKey("1","down",yesfunc)
- unbindKey("num_1","down",yesfunc)
- unbindKey("2","down",nofunc)
- unbindKey("num_2","down",nofunc)
-end
-addEventHandler ( "onClientElementDrop", getRootElement(),function()
- if getElementType(source) == "Teleport_p" or getElementType(source) == "destination_p" then
- isSlelcted[source] = false
- if getElementType(source) == "Teleport_p" then
- lastSelected = source
- end
- end
-end)
-addEventHandler ( "onClientElementDestroyed", getRootElement(),function()
- if getElementType(source) == "Teleport_p" then
- isDestroyed[source] = true
- end
-end)
-function renderineditor()
- local destinations = getElementsByType("destination_p")
- local telepickups = getElementsByType("Teleport_p")
- for i,p in ipairs(destinations) do
- if isSlelcted[p] then
- local tx,ty,tz = exports.edf:edfGetElementPosition(p)
- local x2,y2 = getScreenFromWorldPosition(tx,ty,tz)
- if x2 then
- dxDrawImage( x2-15,y2-15,30,30,":teleporteditor/tar.png")
- --outputChatBox(":TeleportEditor/tar.png")
- end
- for j,t in ipairs(telepickups) do
- local targetid = exports.edf:edfGetElementProperty (t, "destynation_id")
- if targetid then
- if isElement(targetid) and targetid == p then
- local ax,ay,az = exports.edf:edfGetElementPosition(t)
- local x1,y1 = getScreenFromWorldPosition(ax,ay,az)
- if x1 then
- dxDrawImage( x1-15,y1-15,30,30,":teleporteditor/tele.png")
- --outputChatBox(":TeleportEditor/tele.png")
- end
- end
- end
- end
- end
- end
- for i,p in ipairs(telepickups) do
- local ax,ay,az = exports.edf:edfGetElementPosition(p)
- local px,py,pz = getElementPosition(getLocalPlayer())
- local d_text = exports.edf:edfGetElementProperty (p, "description") or "error"
- local dt_color = exports.edf:edfGetElementProperty (p, "desccolor") or "#FFFF0000"
- local x1,y1 = getScreenFromWorldPosition(ax,ay,az)
- local dist = getDistanceBetweenPoints3D(ax,ay,az,px,py,pz)
- local red, gren, blue, alpha = conwert(dt_color)
- if (dist < 100) and x1 and (not isDestroyed[p]) then
- local llen = string.len(d_text)
- llen = math.floor(llen/2)*6
- local size = 50/dist
- dxDrawText(d_text,x1-(llen)*size,y1-(40)*size,x1-(llen)*size,y1-(40)*size,tocolor(red, gren, blue, alpha),size,"arial")
- end
- if isSlelcted[p] then
- local targetid = exports.edf:edfGetElementProperty (p, "destynation_id")
- if x1 then
- dxDrawImage( x1-15,y1-15,30,30,":teleporteditor/tele.png")
- --outputChatBox(":TeleportEditor/tele.png")
- end
- if targetid then
- --outputChatBox("1")
- if isElement(targetid) then
- --outputChatBox("2")
- local tx,ty,tz = exports.edf:edfGetElementPosition(targetid)
- local x2,y2 = getScreenFromWorldPosition(tx,ty,tz)
- if x2 then
- --outputChatBox("3")
- dxDrawImage( x2-15,y2-15,30,30,":teleporteditor/tar.png")
- --outputChatBox(":TeleportEditor/tar.png")
- end
- end
- end
- end
- if exports.edf:edfGetElementProperty (p, "type") == "ring" then
- if isSlelcted[p] then
- local obrep = getRepresentation(p,"object")
- local rx,ry,rz = getElementRotation(obrep)
- local tempobject = createVehicle(594,ax,ay,az,rx,ry,rz)
- setElementRotation (tempobject,rx,ry,rz)
- local matrix = getElementMatrix ( tempobject )
- destroyElement (tempobject)
- local offX = 0 * matrix[1][1] + 50 * matrix[2][1] + 0 * matrix[3][1] + matrix[4][1]
- local offY = 0 * matrix[1][2] + 50 * matrix[2][2] + 0 * matrix[3][2] + matrix[4][2]
- local offZ = 0 * matrix[1][3] + 50 * matrix[2][3] + 0 * matrix[3][3] + matrix[4][3]
- local marker = getRepresentation(p,"marker")
- --outputChatBox(tostring(getElementType(marker))..", "..tostring(offX)..", "..tostring(offY)..", "..tostring(offZ)..", ")
- setMarkerTarget (marker, tonumber(offX), tonumber(offY), tonumber(offZ))
- end
- end
- end
-end
-addEventHandler ( "onClientRender", getRootElement(),renderineditor)
-function getRepresentation(element,type)
- for i,elem in ipairs(getElementsByType(type,element)) do
- if elem ~= exports.edf:edfGetHandle ( elem ) then
- return elem
- end
- end
- return false
-end
-function conwert(color)
- local hexTodecim = {["0"]=0,["1"]=1,["2"]=2,["3"]=3,["4"]=4,["5"]=5,["6"]=6,["7"]=7,["8"]=8,["9"]=9,["a"]=10,["b"]=11,["c"]=12,["d"]=13,["e"]=14,["f"]=15}
- local red = (hexTodecim[string.lower(string.sub(color, 2, 2))]*16) + hexTodecim[string.lower(string.sub(color, 3, 3))]
- local gren = (hexTodecim[string.lower(string.sub(color, 4, 4))]*16) + hexTodecim[string.lower(string.sub(color, 5, 5))]
- local blue = (hexTodecim[string.lower(string.sub(color, 6, 6))]*16) + hexTodecim[string.lower(string.sub(color, 6, 6))]
- local alpha = (hexTodecim[string.lower(string.sub(color, 8, 8))]*16) + hexTodecim[string.lower(string.sub(color, 9, 9))]
- return red, gren, blue, alpha
-end
---[[addCommandHandler("setmydim",function(com,arg)
- local dim = tonumber(arg)
- if dim and dim >= 0 then
- dim = math.floor(dim)
- setElementDimension(getLocalPlayer(),dim)
- outputChatBox("Dimension set to: "..dim)
- else
- outputChatBox("error: bad argument")
- end
-end)]]
-addCommandHandler("setmyint",function(com,arg)
- local dim = tonumber(arg)
- if dim and dim >= 0 then
- dim = math.floor(dim)
- setElementInterior(getLocalPlayer(),dim)
- outputChatBox("Interior set to: "..dim)
- else
- outputChatBox("error: bad argument")
- end
-end)
-local pretelep = getElementsByType("Teleport_p")
-for i,p in ipairs(pretelep) do
- if exports.edf:edfGetElementProperty (p, "type") == "ring" then
- local ax,ay,az = exports.edf:edfGetElementPosition(p)
- local obrep = getRepresentation(p,"object")
- local rx,ry,rz = getElementRotation(obrep)
- local tempobject = createVehicle(594,ax,ay,az,rx,ry,rz)
- setElementRotation (tempobject,rx,ry,rz)
- local matrix = getElementMatrix ( tempobject )
- destroyElement (tempobject)
- local offX = 0 * matrix[1][1] + 50 * matrix[2][1] + 0 * matrix[3][1] + matrix[4][1]
- local offY = 0 * matrix[1][2] + 50 * matrix[2][2] + 0 * matrix[3][2] + matrix[4][2]
- local offZ = 0 * matrix[1][3] + 50 * matrix[2][3] + 0 * matrix[3][3] + matrix[4][3]
- local marker = getRepresentation(p,"marker")
- --outputChatBox(tostring(getElementType(marker))..", "..tostring(offX)..", "..tostring(offY)..", "..tostring(offZ)..", ")
- setMarkerTarget (marker, tonumber(offX), tonumber(offY), tonumber(offZ))
- end
- --local dim = exports.edf:edfGetElementProperty(p, "dimension_")
- local int = exports.edf:edfGetElementProperty(p, "interior_")
- --exports.edf:edfSetElementDimension (p, dim)
- --exports.edf:edfSetElementInterior (p, int)
- triggerServerEvent("onchangei",getLocalPlayer(),p,int)
-end
-pretelep = getElementsByType("destination_p")
-for i,p in ipairs(pretelep) do
- --local dim = exports.edf:edfGetElementProperty(p, "t_dimension")
- local int = exports.edf:edfGetElementProperty(p, "t_interior")
- --exports.edf:edfSetElementDimension (p, dim)
- --exports.edf:edfSetElementInterior (p, int)
- triggerServerEvent("onchangei",getLocalPlayer(),p,int)
- --outputChatBox(int)
-end
-
-
-
-
diff --git a/DayZ/handlers/houses/teleporteditor/edf_sr.lua b/DayZ/handlers/houses/teleporteditor/edf_sr.lua
deleted file mode 100644
index f460a14..0000000
--- a/DayZ/handlers/houses/teleporteditor/edf_sr.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-addEvent("onchangei",true)
-addEventHandler ( "onchangei", getRootElement(),function(elem,int)
- exports.edf:edfSetElementInterior (elem, int)
- --outputChatBox(int)
-end)
diff --git a/DayZ/handlers/houses/teleporteditor/tar.png b/DayZ/handlers/houses/teleporteditor/tar.png
deleted file mode 100644
index 470f4cb..0000000
Binary files a/DayZ/handlers/houses/teleporteditor/tar.png and /dev/null differ
diff --git a/DayZ/handlers/houses/teleporteditor/tele.png b/DayZ/handlers/houses/teleporteditor/tele.png
deleted file mode 100644
index 6afbe05..0000000
Binary files a/DayZ/handlers/houses/teleporteditor/tele.png and /dev/null differ
diff --git a/DayZ/handlers/houses/teleporteditor/tele_cl.lua b/DayZ/handlers/houses/teleporteditor/tele_cl.lua
deleted file mode 100644
index 10f0bd7..0000000
--- a/DayZ/handlers/houses/teleporteditor/tele_cl.lua
+++ /dev/null
@@ -1,262 +0,0 @@
-local roottelepick = createElement ("Rootmarker", "RootTeleportPickup")
-local telepicktargets = {}
-local telepickdesc = {}
-local telepickdesccol = {}
-local restrictions = {}
-function conwert(color)
- local hexTodecim = {["0"]=0,["1"]=1,["2"]=2,["3"]=3,["4"]=4,["5"]=5,["6"]=6,["7"]=7,["8"]=8,["9"]=9,["a"]=10,["b"]=11,["c"]=12,["d"]=13,["e"]=14,["f"]=15}
- local red = (hexTodecim[string.lower(string.sub(color, 2, 2))]*16) + hexTodecim[string.lower(string.sub(color, 3, 3))]
- local gren = (hexTodecim[string.lower(string.sub(color, 4, 4))]*16) + hexTodecim[string.lower(string.sub(color, 5, 5))]
- local blue = (hexTodecim[string.lower(string.sub(color, 6, 6))]*16) + hexTodecim[string.lower(string.sub(color, 6, 6))]
- local alpha = (hexTodecim[string.lower(string.sub(color, 8, 8))]*16) + hexTodecim[string.lower(string.sub(color, 9, 9))]
- return red, gren, blue, alpha
-end
-function StartResourceTE()
- local telepick = getElementsByType("Teleport_p")
- if telepick and table.getn (telepick) > 0 then
- for i,t in ipairs (telepick) do
- local x,y,z = getElementPosition (t)
- local rx,ry,rz = tonumber(getElementData(t, "rotX")),tonumber(getElementData(t, "rotY")),tonumber(getElementData(t, "rotZ"))
- local ttype = getElementData(t, "type")
- local size = tonumber(getElementData(t, "size"))
- if size < 1 then
- size = 1
- end
- local color = getElementData(t, "color")
- local description = getElementData(t, "description") or "test"
- local desccolor = getElementData(t, "desccolor")
- local destynation_id = getElementData(t, "destynation_id")
- local dimension = math.floor(tonumber(getElementData(t, "dimension_"))) or 0
- if dimension < 0 then
- dimension = 0
- end
- local interior = math.floor(tonumber(getElementData(t, "interior_"))) or 0
- if interior < 0 then
- interior = 0
- end
- local restrict = getElementData(t, "restriction")
- local red, gren, blue, alpha = conwert(color)
- local dred, dgren, dblue, dalpha = conwert(desccolor)
- if isElement (getElementByID(destynation_id)) then
- local marker = createMarker(x,y,z,ttype,size,red,gren,blue,alpha)
- setElementDimension (marker, dimension)
- setElementInterior (marker, interior)
- telepicktargets[marker] = getElementByID(destynation_id)
- telepickdesc[marker] = description
- telepickdesccol[marker] = {dred, dgren, dblue, dalpha}
- restrictions[marker] = restrict
- setElementParent(marker,roottelepick)
- if ttype == "ring" then
- local tempobject = createVehicle(594,x,y,z,rx,ry,rz)
- setElementRotation (tempobject,rx,ry,rz)
- local matrix = getElementMatrix ( tempobject )
- destroyElement (tempobject)
- local offX = 0 * matrix[1][1] + 100 * matrix[2][1] + 0 * matrix[3][1] + matrix[4][1]
- local offY = 0 * matrix[1][2] + 100 * matrix[2][2] + 0 * matrix[3][2] + matrix[4][2]
- local offZ = 0 * matrix[1][3] + 100 * matrix[2][3] + 0 * matrix[3][3] + matrix[4][3]
- --outputChatBox(tostring(offX).."' "..tostring(offY)..", "..tostring(offZ)..", "..tostring(x)..", "..tostring(y)..", "..tostring(z)..", "..tostring(getElementType(marker)))
- setMarkerTarget (marker, tonumber(offX), tonumber(offY), tonumber(offZ))
- --[[elseif ttype == "arrow" or ttype == "cylinder" then
- local tempobject = createObject(1318,x,y,z)
- setObjectScale(tempobject,0,001)
- setElementRotation(tempobject,rx,ry,rz)
- attachElements(marker,tempobject)]]
- end
- else
- outputDebugString("TE: Teleport (id: "..getElementID(t)..") has no destination set - this teleport wont be created")
- end
- end
- else
- outputDebugString("TE: No telepotr pickup markers detected in map file...")
- end
-end
-local localplayer = getLocalPlayer()
-addEventHandler("onClientRender",getRootElement(),function()
- if isElement(roottelepick) then
- local telmark = getElementChildren(roottelepick)
- for i,p in ipairs(telmark) do
- if isElement(p) then
- if getElementDimension(p) == getElementDimension(localplayer) and getElementInterior(p) == getElementInterior(localplayer) then
- local ax,ay,az = getElementPosition(p)
- local px,py,pz = getElementPosition(localplayer)
- local d_text = telepickdesc[p]
- local dt_color = telepickdesccol[p]
- local x1,y1 = getScreenFromWorldPosition(ax,ay,az)
- local dist = getDistanceBetweenPoints3D(ax,ay,az,px,py,pz)
- if (dist < 50) and x1 then
- local llen = string.len(d_text)
- llen = math.floor(llen/2)*6
- local size = (10/dist)
- local sizes = size + 1
- --[[if size > 15 then
- size = 15
- elseif size < 0.2 then
- size = 0.2
- end]]
- dxDrawText(d_text,x1-(llen)*sizes,y1-(60)*size,x1-(llen)*sizes,y1-(60)*size,tocolor(unpack(dt_color)),sizes,"arial")
- end
- end
- end
- end
- end
-end)
-function teleportpickuphandler(player,machdimension)
- if (player == localplayer) and machdimension and (getElementInterior(player) == getElementInterior(source)) then
- local target = telepicktargets[source]
- local timrmark = source
- local veh = getPedOccupiedVehicle(player)
- local tx,ty,tz = getElementPosition(target)
- local relativet = getElementData(target, "relative")
- local restrict = restrictions[source]
- local targetdimension = math.floor(tonumber(getElementData(target, "t_dimension"))) or 0
- if targetdimension < 0 then
- targetdimension = 0
- end
- local targetinterior = math.floor(tonumber(getElementData(target, "t_interior"))) or 0
- if targetinterior < 0 then
- targetinterior = 0
- end
- local fixed_speed = tonumber(tonumber(getElementData(target, "fixed_speed"))) or 0
- if fixed_speed < 0 then
- fixed_speed = 0
- end
- local speed_multiplayer = tonumber(tonumber(getElementData(target, "speed_multiplayer"))) or 1
- if speed_multiplayer < 0 then
- speed_multiplayer = 1
- end
- if veh and isElement(veh) and (getVehicleOccupant(veh,0) == player) and restrict ~= "playerOnly" then
- local ax,ay,az = getElementPosition(veh)
- local vx,vy,vz = getElementVelocity(veh)
- setElementFrozen(veh,true)
- local actualspeed = (vx^2 + vy^2 + vz^2)^(0.5)
- local rx,ry,rz = 0,0,0
- if getElementData(target, "use_dest_rot") == "true" then
- rx,ry,rz = tonumber(getElementData(target, "rotX")),tonumber(getElementData(target, "rotY")),tonumber(getElementData(target, "rotZ"))
- else
- rx,ry,rz = getElementRotation(veh)
- end
- setElementRotation (veh,rx,ry,rz)
- local matrix = getElementMatrix(veh)
- if relativet == "coord" then
- tx = tx + ax
- ty = ty + ay
- tz = tz + az
- elseif relativet == "coordNrot" then
- local offx = tx * matrix[1][1] + ty * matrix[2][1] + tz * matrix[3][1] + matrix[4][1]
- local offy = tx * matrix[1][2] + ty * matrix[2][2] + tz * matrix[3][2] + matrix[4][2]
- local offz = tx * matrix[1][3] + ty * matrix[2][3] + tz * matrix[3][3] + matrix[4][3]
- tx = offx
- ty = offy
- tz = offz
- end
- setElementPosition (veh,tx,ty,tz)
- matrix = getElementMatrix(veh)
- camerastuff(player,matrix,tx,ty,tz)
- setCameraTarget(player)
- setTimer(function()
- if targetdimension ~= getElementDimension(timrmark) or targetinterior ~= getElementInterior(timrmark) then
- triggerServerEvent("onTeleport",getLocalPlayer(),veh,targetdimension,targetinterior)
- local ocupants = getVehicleOccupants(veh)
- local attached = getAttachedElements(veh)
- for i,p in pairs(ocupants) do
- triggerServerEvent("onTeleport",getLocalPlayer(),p,targetdimension,targetinterior)
- end
- for i,p in pairs(attached) do
- triggerServerEvent("onTeleport",getLocalPlayer(),p,targetdimension,targetinterior)
- end
- end
- setElementFrozen(veh,false)
- if fixed_speed > 0 then
- fixed_speed = (fixed_speed/180)
- sermatspeed(veh,matrix,fixed_speed,tx,ty,tz)
- --outputChatBox(fixed_speed.." fixed_speed")
- else
- actualspeed = actualspeed * speed_multiplayer
- sermatspeed(veh,matrix,actualspeed,tx,ty,tz)
- --outputChatBox(actualspeed.." actualspeed")
- end
- end,50,1)
- elseif veh and isElement(veh) then
- --nothing
- else
- if not isElementAttached(player) and restrict ~= "inVehicleOnly" then
- local ax,ay,az = getElementPosition(player)
- local vx,vy,vz = getElementVelocity(player)
- --local a1,a2,a3,a4 = getPedSimplestTask(player)
- --outputChatBox(tostring(a1)..tostring(a2)..tostring(a3)..tostring(a4))
- setElementFrozen(player,true)
- local actualspeed = (vx^2 + vy^2 + vz^2)^(0.5)
- local rx,ry,rz = 0,0,0
- if getElementData(target, "use_dest_rot") == "true" then
- rx,ry,rz = tonumber(getElementData(target, "rotX")),tonumber(getElementData(target, "rotY")),tonumber(getElementData(target, "rotZ"))
- --outputChatBox("target rot"..rx..", "..ry..", "..rz)
- else
- rz = getPedRotation(player)
- --outputChatBox("pla rot")
- end
- setPedRotation(player,rz)
- local matrix = getElementMatrix(player)
- if getElementData(target, "use_dest_rot") == "true" then
- --outputChatBox("target rot2"..rx..", "..ry..", "..rz)
- local tempobject = createVehicle(594,tx,ty,tz,rx,ry,rz)
- setElementRotation (tempobject,rx,ry,rz)
- matrix = getElementMatrix ( tempobject )
- destroyElement (tempobject)
- end
- if relativet == "coord" then
- tx = tx + ax
- ty = ty + ay
- tz = tz + az
- elseif relativet == "coordNrot" then
- local offx = tx * matrix[1][1] + ty * matrix[2][1] + tz * matrix[3][1] + matrix[4][1]
- local offy = tx * matrix[1][2] + ty * matrix[2][2] + tz * matrix[3][2] + matrix[4][2]
- local offz = tx * matrix[1][3] + ty * matrix[2][3] + tz * matrix[3][3] + matrix[4][3]
- tx = offx
- ty = offy
- tz = offz
- end
- setElementPosition(player,tx,ty,tz)
- matrix = getElementMatrix(player)
- if getElementData(target, "use_dest_rot") == "true" then
- --outputChatBox("target rot2"..rx..", "..ry..", "..rz)
- local tempobject = createVehicle(594,tx,ty,tz,rx,ry,rz)
- setElementRotation (tempobject,rx,ry,rz)
- matrix = getElementMatrix ( tempobject )
- destroyElement (tempobject)
- end
- camerastuff(player,matrix,tx,ty,tz)
- setCameraTarget(player)
- setTimer(function()
- if targetdimension ~= getElementDimension(timrmark) or targetinterior ~= getElementInterior(timrmark) then
- triggerServerEvent("onTeleport",getLocalPlayer(),player,targetdimension,targetinterior)
- end
- setElementFrozen(player,false)
- if tonumber(fixed_speed) > 0 then
- fixed_speed = fixed_speed/180
- sermatspeed(player,matrix,fixed_speed,tx,ty,tz)
- else
- actualspeed = actualspeed * speed_multiplayer
- sermatspeed(player,matrix,actualspeed,tx,ty,tz)
- end
- end,50,1)
- end
- end
- end
-end
-addEventHandler("onClientMarkerHit", roottelepick, teleportpickuphandler)
-function sermatspeed(element,matrix,ofset,x,y,z)
- local offX = 0 * matrix[1][1] + ofset * matrix[2][1] + 0 * matrix[3][1] + matrix[4][1]
- local offY = 0 * matrix[1][2] + ofset * matrix[2][2] + 0 * matrix[3][2] + matrix[4][2]
- local offZ = 0 * matrix[1][3] + ofset * matrix[2][3] + 0 * matrix[3][3] + matrix[4][3]
- setElementVelocity(element,offX-x,offY-y,offZ-z)
- --outputChatBox(offX-x.."' "..offY-y..", "..offZ-z)
-end
-function camerastuff(player,matrix,x,y,z)
- local offX = 0 * matrix[1][1] - 2 * matrix[2][1] + 1 * matrix[3][1] + matrix[4][1]
- local offY = 0 * matrix[1][2] - 2 * matrix[2][2] + 1 * matrix[3][2] + matrix[4][2]
- local offZ = 0 * matrix[1][3] - 2 * matrix[2][3] + 1 * matrix[3][3] + matrix[4][3]
- setCameraMatrix(tonumber(offX),tonumber(offY),tonumber(offZ),x,y,z)
- --outputChatBox(getElementType(player)..", "..offX..", "..offY..", "..offZ..", "..x..", "..y..", "..z)
-end
-
-setTimer(StartResourceTE,1000,1)
diff --git a/DayZ/handlers/houses/teleporteditor/tele_sr.lua b/DayZ/handlers/houses/teleporteditor/tele_sr.lua
deleted file mode 100644
index 7d361e7..0000000
--- a/DayZ/handlers/houses/teleporteditor/tele_sr.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-addEvent("onTeleport",true)
-addEventHandler ( "onTeleport", getRootElement(),function (element,dim,inter)
- setElementDimension(element,dim)
- setElementInterior(element,inter)
-end)
diff --git a/DayZ/handlers/houses/teleporteditor/teleport.edf b/DayZ/handlers/houses/teleporteditor/teleport.edf
deleted file mode 100644
index 1d0474a..0000000
--- a/DayZ/handlers/houses/teleporteditor/teleport.edf
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/DayZ/handlers/players/client/damage_player.lua b/DayZ/handlers/players/client/damage_player.lua
index 4dcb152..729b4c8 100644
--- a/DayZ/handlers/players/client/damage_player.lua
+++ b/DayZ/handlers/players/client/damage_player.lua
@@ -8,16 +8,185 @@
#-----------------------------------------------------------------------------#
]]
+function dayZPlayerDamage(attacker,weapon,bodypart,loss)
+ cancelEvent()
+ local damage = 0
+ local headshot = false
+ local halfDamage = 1
+ local damageMultiplier = 1
+ if weapon == 37 then return end
+
+ -- Attacker: Zombie
+ if isElement(attacker) and getElementData(attacker,"zombie") then
+ if getElementData(localPlayer,"humanity") >= 5000 then
+ halfDamage = 2
+ end
+ local difficulty = gameplayVariables["difficulty"]
+ if difficulty then
+ if difficulty == "veteran" then
+ damageMultiplier = 1.5
+ elseif difficulty == "hardcore" then
+ damageMultiplier = 3
+ end
+ else
+ damageMultiplier = 1
+ end
+ setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-((gameplayVariables["zombiedamage"]*damageMultiplier)/halfDamage))
+ enableBlackWhite(true)
+ setTimer(function() enableBlackWhite(false) end,1000,1)
+ local painChance = math.min((((gameplayVariables["zombiedamage"]*damageMultiplier)/halfDamage)/100),100)
+ local bleedChance = 15
+ if math.random(0,100) <= painChance then
+ setElementData(localPlayer,"pain",true)
+ end
+ if math.random(0,100) <= bleedChance then
+ setElementData(localPlayer,"bleeding",math.floor(painChance*25))
+ end
+
+ -- Attacker: Player
+ elseif isElement(attacker) and getElementType(attacker) == "player" then
+ if weapon and weapon > 1 then
+ damage = getWeaponDamage(weapon,attacker)
+ local x1,y1,z1 = getElementPosition(localPlayer)
+ local x2,y2,z2 = getElementPosition(attacker)
+ local distance = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2)
+ damage = damage-(distance*5)
+ if bodypart == 5 or bodypart == 6 then
+ damage = damage/1.07
+ setElementData(localPlayer,"fracturedArms",true)
+ playSound(":DayZ/sounds/status/bonecrack.mp3",false)
+ playSFX("pain_a",2,98,false)
+ elseif bodypart == 7 or bodypart == 8 then
+ damage = damage/1.05
+ setElementData(localPlayer,"fracturedLegs",true)
+ playSound(":DayZ/sounds/status/bonecrack.mp3",false)
+ playSFX("pain_a",2,95,false)
+ elseif bodypart == 9 then
+ local hasHelmet
+ if gameplayVariables["newclothingsystem"] then
+ hasHelmet = getPedClothes(localPlayer,16)
+ if hasHelmet == "helmet" or hasHelmet == "moto" then
+ if weapon ~=34 then
+ damage = 0
+ playSFX("genrl",20,12,false)
+ else
+ damage = damage*gameplayVariables["headshotdamage_player"]
+ headshot = true
+ playSFX("pain_a",2,38,false)
+ end
+ end
+ else
+ hasHelmet = getElementData(localPlayer,"hasHelmet")
+ if hasHelmet then
+ if weapon ~=34 then
+ damage = 0
+ playSFX("genrl",20,12,false)
+ else
+ damage = damage*gameplayVariables["headshotdamage_player"]
+ headshot = true
+ playSFX("pain_a",2,38,false)
+ end
+ end
+ end
+
+ end
+ if getElementData(localPlayer,"humanity") >= 5000 then
+ if damage <= 1000 then
+ damage = 0
+ end
+ end
+ if damage > 0 then
+ setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(damage))
+ enableBlackWhite(true)
+ setTimer(function() enableBlackWhite(false) end,1000,1)
+ if damage >= 6000 then
+ if math.random() < 0.5 then
+ setElementData(localPlayer,"unconscious",true)
+ end
+ if not getElementData(localPlayer,"unconscious") then
+ setElementData(localPlayer,"pain",true)
+ end
+ end
+ setElementData(localPlayer,"bleeding",getElementData(localPlayer,"bleeding")+10)
+ end
+ local humanityHit = 0
+ local myKills = 200-(getElementData(localPlayer,"murders")*3.3)
+ humanityHit = math.abs(myKills-damage)
+ if humanityHit >= 800 then
+ humanityHit = 800
+ end
+ if not getElementData(localPlayer,"bandit") then
+ triggerServerEvent("onPlayerChangeStatus",attacker,"humanity",humanityHit)
+ else
+ triggerServerEvent("onPlayerChangeStatus",attacker,"humanity",-humanityHit)
+ end
+ end
+ end
+
+ -- Attacker: Explosions & Vehicle Crash/Runover
+ if weapon == 49 or weapon == 50 then
+ if loss >= 30 then
+ setElementData(localPlayer,"fracturedLegs",true)
+ setElementData(localPlayer,"fracturedArms",true)
+ playSound(":DayZ/sounds/status/bonecrack.mp3",false)
+ playSFX("pain_a",2,95,false)
+ setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(loss*10))
+ else
+ setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(loss*5))
+ end
+ enableBlackWhite(true)
+ setTimer(function() enableBlackWhite(false) end,1000,1)
+ elseif weapon == 63 or weapon == 51 or weapon == 19 then
+ if not getElementData(localPlayer,"isDead") then
+ setElementData(localPlayer,"blood",0)
+ end
+ elseif weapon == 54 then
+ local gravity = math.min(9.81,(loss/10))
+ local potentialEnergy = gravity*(loss/10)
+ local kineticEnergy = potentialEnergy/(5*9.81)
+ if loss >= 30 then
+ if kineticEnergy >= 0.001 then
+ setElementData(localPlayer,"fracturedLegs",true)
+ playSound(":DayZ/sounds/status/bonecrack.mp3",false)
+ playSFX("pain_a",2,95,false)
+ setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(potentialEnergy*25*loss))
+ end
+ else
+ setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(potentialEnergy*25*loss))
+ end
+ enableBlackWhite(true)
+ setTimer(function() enableBlackWhite(false) end,1000,1)
+ end
+
+ -- Final calculations
+ if getElementData(localPlayer,"blood") <= 0 then
+ if not getElementData(localPlayer,"isDead") then
+ triggerServerEvent("kilLDayZPlayer",localPlayer,attacker,headshot)
+ setElementData(localPlayer,"isDead",true)
+ end
+ end
+ local gender = getElementData(localPlayer,"gender")
+ if gender == "male" then
+ playSFX("pain_a",2,53,false)
+ elseif gender == "female" then
+ playSFX("pain_a",1,52,false)
+ end
+end
+addEventHandler ("onClientPlayerDamage",localPlayer,dayZPlayerDamage)
+
+
function playerDayZDamage(attacker,weapon,bodypart,loss)
cancelEvent()
damage = 100
headshot = false
damage_half = 1
multiplier = 1
+
if weapon == 37 then
return
end
- if getElementData(attacker,"zombie") then
+
+ if isElement(attacker) and getElementData(attacker,"zombie") then
if getElementData(localPlayer,"humanity") >= 5000 then
damage_half = 2
else
@@ -51,6 +220,7 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
setElementData(localPlayer,"infection",true)
end
end
+
if weapon == 49 then
if loss > 30 then
setElementData(localPlayer,"brokenbone",true)
@@ -66,20 +236,30 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
end
end
end
+
if weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then
damage = getWeaponDamage(weapon,attacker)
local x1,y1,z1 = getElementPosition(localPlayer)
local x2,y2,z2 = getElementPosition(attacker)
local distance = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2)
damage = damage-(distance*5)
+
if bodypart == 9 then
+ local hasHelmet = getPedClothes(source,16)
+ if hasHelmet == "helmet" or hasHelmet == "moto" then
+ if weapon ~= 34 then
+ damage = 0
+ end
+ end
damage = damage*gameplayVariables["headshotdamage_player"]
headshot = true
end
+
if bodypart == 7 or bodypart == 8 then
setElementData(localPlayer,"brokenbone",true)
playSound(":DayZ/sounds/status/bonecrack.mp3",false)
end
+
if getElementData(localPlayer,"humanity") >= 5000 then
if damage <= 1000 then
damage = 0
@@ -87,18 +267,22 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
damage = damage
end
end
+
setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(damage))
enableBlackWhite(true)
setTimer(function() enableBlackWhite(false) end,1000,1)
+
if damage >= 6000 then
setElementData(localPlayer,"unconscious",true)
end
+
local number = math.random(1,8)
if number >= 6 and number <= 8 then
if damage > 0 then
setElementData(localPlayer,"bleeding",getElementData(localPlayer,"bleeding") + math.floor(loss*10))
end
end
+
local number = math.random(1,7)
if number == 2 then
setElementData(localPlayer,"pain",true)
@@ -115,9 +299,11 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
local myKills = 200 - ((getElementData(localPlayer,"murders") / 3) * 150)
local rawDamage = math.floor(math.sqrt((damage/55.55)))
local humanityHit = -(myKills * rawDamage)
+
if humanityHit > -800 then
humanityHit = -800
end
+
if not getElementData(localPlayer,"bandit") then
triggerServerEvent("onPlayerChangeStatus",attacker,"humanity",math.floor(humanityHit))
if getElementData(attacker,"humanity") < 0 then
@@ -132,6 +318,7 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
setElementData(attacker,"bandit",false)
end
end
+
if getElementData(localPlayer,"blood") <= 0 then
if not getElementData(localPlayer,"isDead") then
triggerServerEvent("kilLDayZPlayer",localPlayer,attacker,headshot,getWeaponNameFromID(weapon))
@@ -142,19 +329,23 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.random(100,1000))
enableBlackWhite(true)
setTimer(function() enableBlackWhite(false) end,1000,1)
+
local number = math.random(1,5)
if loss > 30 then
setElementData(localPlayer,"brokenbone",true)
setControlState ("jump",true)
end
+
if loss >= 100 then
setElementData(localPlayer,"blood",49)
setElementData(localPlayer,"bleeding",50)
end
+
local number = math.random(1,11)
if number == 3 then
setElementData(localPlayer,"pain",true)
end
+
if getElementData(localPlayer,"blood") <= 0 then
if not getElementData(localPlayer,"isDead") == true then
triggerServerEvent("kilLDayZPlayer",localPlayer,attacker,headshot,getWeaponNameFromID (weapon))
@@ -162,8 +353,14 @@ function playerDayZDamage(attacker,weapon,bodypart,loss)
end
end
end
+ local gender = getElementData(localPlayer,"gender")
+ if gender == "male" then
+ playSFX("pain_a",2,53,false)
+ elseif gender == "female" then
+ playSFX("pain_a",1,52,false)
+ end
end
-addEventHandler ("onClientPlayerDamage",localPlayer,playerDayZDamage)
+--addEventHandler ("onClientPlayerDamage",localPlayer,playerDayZDamage)
function onPlayerDamageShader()
@@ -203,6 +400,7 @@ function isPlayerUsingBinoculars(button, press)
else
visible = rangefinder
end
+
if button == "mouse2" then
if press then
guiSetVisible(visible,true)
@@ -217,10 +415,11 @@ end
addEventHandler("onClientKey",root,isPlayerUsingBinoculars)
function rangeFinder()
-local w, h = guiGetScreenSize ()
-local tx, ty, tz = getWorldFromScreenPosition ( w/2, h/2, 500 )
-local px, py, pz = getPedBonePosition(localPlayer,8)
-hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, tx, ty, tz )
+ local w, h = guiGetScreenSize ()
+ local tx, ty, tz = getWorldFromScreenPosition ( w/2, h/2, 500 )
+ local px, py, pz = getPedBonePosition(localPlayer,8)
+ hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, tx, ty, tz )
+
if getPedWeapon(localPlayer) == 43 and getElementData(localPlayer, "currentweapon_2") == "Range Finder" then
if getControlState("aim_weapon") then
if x and y and z then
diff --git a/DayZ/handlers/players/client/flashlight/c_shader_light.lua b/DayZ/handlers/players/client/flashlight/c_shader_light.lua
index 831c6c7..ab911a9 100644
--- a/DayZ/handlers/players/client/flashlight/c_shader_light.lua
+++ b/DayZ/handlers/players/client/flashlight/c_shader_light.lua
@@ -185,7 +185,7 @@ end
function whenPlayerQuits(this_player)
destroyWorldLightShader(this_player)
- destroyFlashlightModel(this_player)
+ --destroyFlashlightModel(this_player)
destroyFlashLightShader(this_player)
end
diff --git a/DayZ/handlers/players/client/fpm_player.lua b/DayZ/handlers/players/client/fpm_player.lua
index ebda4de..76afe8d 100644
--- a/DayZ/handlers/players/client/fpm_player.lua
+++ b/DayZ/handlers/players/client/fpm_player.lua
@@ -242,10 +242,13 @@ function freecamMouse (cX,cY,aX,aY)
elseif rotY > PI / 3.5 then
rotY = PI / 3.5
end
+ --[[
+ -- Disabled till the appropriate math is found
if rotX < -PI / 2 then
rotX = -PI / 2
elseif rotX > PI / 2 then
rotX = PI / 2
end
+ ]]
end
end
\ No newline at end of file
diff --git a/DayZ/handlers/players/client/status_player.lua b/DayZ/handlers/players/client/status_player.lua
index f1383f9..ccc53b1 100644
--- a/DayZ/handlers/players/client/status_player.lua
+++ b/DayZ/handlers/players/client/status_player.lua
@@ -64,7 +64,7 @@ function setPlayerBleeding()
end
end
end
-setTimer(setPlayerBleeding,1000,0)
+setTimer(setPlayerBleeding,3000,0)
function setPlayerDeath()
if getElementData(localPlayer,"logedin") then
@@ -77,6 +77,30 @@ function setPlayerDeath()
end
setTimer(setPlayerDeath,1000,0)
+function setPlayerFracturedBones()
+ if getElementData(localPlayer,"logedin") then
+ if getElementData(localPlayer,"fracturedLegs") then
+ toggleControl("jump",false)
+ toggleControl("sprint",false)
+ setElementData(localPlayer,"brokenbone",true)
+ else
+ toggleControl("jump",true)
+ toggleControl("sprint",true)
+ setElementData(localPlayer,"brokenbone",false)
+ end
+ if getElementData(localPlayer,"fracturedArms") then
+ toggleControl("aim_weapon",false)
+ toggleControl("fire",false)
+ setElementData(localPlayer,"brokenbone",true)
+ else
+ toggleControl("aim_weapon",true)
+ toggleControl("fire",true)
+ setElementData(localPlayer,"brokenbone",false)
+ end
+ end
+end
+setTimer(setPlayerFracturedBones,2000,0)
+
function setPlayerBrokenbone()
if getElementData(localPlayer,"logedin") then
if getElementData(localPlayer,"brokenbone") then
@@ -88,7 +112,7 @@ function setPlayerBrokenbone()
end
end
end
-setTimer(setPlayerBrokenbone,2000,0)
+--setTimer(setPlayerBrokenbone,2000,0)
function setPlayerCold()
if getElementData(localPlayer,"logedin") then
@@ -105,11 +129,11 @@ function setPlayerCold()
if randomsound >= 0 and randomsound <= 10 then
local getnumber = math.random(0,2)
playSound(":DayZ/sounds/status/cough_"..getnumber..".ogg",false)
- setElementData(localPlayer,"volume",100)
- setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
+ --setElementData(localPlayer,"volume",100)
+ --setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
elseif randomsound >= 11 and randomsound <= 20 then
- setElementData(localPlayer,"volume",100)
- setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
+ --setElementData(localPlayer,"volume",100)
+ --setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
playSound(":DayZ/sounds/status/sneezing.mp3",false)
end
end
@@ -127,17 +151,31 @@ end
addEvent("isPlayerInBuilding",true)
addEventHandler("isPlayerInBuilding",root,isPlayerInBuilding)
+local painTimer = 1500
function setPlayerPain()
if getElementData(localPlayer,"logedin") then
if getElementData(localPlayer,"pain") then
- setCameraShakeLevel(gameplayVariables["painshakelevel"])
- setTimer(setCameraShakeLevel,15000,1,0)
+ if gameplayVariables["painshakesway"] then
+ painTimer = 90000
+ setCameraShakeLevel(gameplayVariables["painshakelevel"])
+ setTimer(setCameraShakeLevel,15000,1,0)
+ else
+ painTimer = 1500
+ local x,y,z = getElementPosition(getLocalPlayer())
+ createExplosion (x,y,z+15,8,false,1.0,false)
+ local x, y, z, lx, ly, lz = getCameraMatrix() -- Get the current location and lookat of camera
+ x, lx = x + 1, lx + 1 -- What will be the new x and x lookat values
+ setCameraMatrix(x,y,z,lx,ly,lz) -- Set camera to new position
+ setCameraTarget (getLocalPlayer())
+ end
else
- setCameraShakeLevel(0)
+ if gameplayVariables["painshakesway"] then
+ setCameraShakeLevel(0)
+ end
end
end
end
-setTimer(setPlayerPain,90000,0)
+setTimer(setPlayerPain,painTimer,0)
--[[
Volume (Noise):
@@ -278,7 +316,7 @@ function updateDaysAliveTime()
setElementData(localPlayer,"daysalive",daysalive+1)
end
end
-setTimer(updateDaysAliveTime,2880000,0)
+--setTimer(updateDaysAliveTime,60000,0)
function updatePlayTime()
if getElementData(localPlayer,"logedin") then
@@ -288,6 +326,7 @@ function updatePlayTime()
end
setTimer(updatePlayTime,60000,0)
+--[[
function updateHoursAliveTime()
if getElementData(localPlayer,"logedin") then
local hourstime = getElementData(localPlayer,"hoursalive")
@@ -295,6 +334,7 @@ function updateHoursAliveTime()
end
end
setTimer(updateHoursAliveTime,3600000,0)
+]]
function playerBloodInWater()
if getElementData(localPlayer, "logedin") then
@@ -454,11 +494,11 @@ function infectionSigns()
if randomsound >= 0 and randomsound <= 20 then
local getnumber = math.random(0,2)
playSound(":DayZ/sounds/status/cough_"..getnumber..".ogg",false)
- setElementData(localPlayer,"volume",100)
- setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
+ --setElementData(localPlayer,"volume",100)
+ --setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
elseif randomsound >= 21 and randomsound <= 40 then
- setElementData(localPlayer,"volume",100)
- setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
+ --setElementData(localPlayer,"volume",100)
+ --setTimer(function() setElementData(localPlayer,"volume",0) end,1500,1)
playSound(":DayZ/sounds/status/sneezing.mp3",false)
end
end
@@ -466,6 +506,7 @@ function infectionSigns()
end
setTimer(infectionSigns,10000,0)
+--[[
local sepsisTimer = 10000
function checkSepsis()
if getElementData(localPlayer,"logedin") then
@@ -530,17 +571,18 @@ function transmitSepsis()
end
end
setTimer(transmitSepsis,30000,0)
+]]
local isHourGlassActive = false
function setPlayerUnconsciousWhenLowBlood()
if getElementData(localPlayer,"logedin") then
- if getElementData(localPlayer,"blood") < 3000 and not getElementData(localPlayer,"unconscious") then
+ if getElementData(localPlayer,"blood") < 3000 and not getElementData(localPlayer,"unconscious") and not getElementData(localPlayer,"isDead") then
local number = math.random(1,100)
if number == 1 then
if not isHourGlassActive then
addEventHandler("onClientRender",root,drawHourGlass)
isHourGlassActive = true
- setPedAnimation(localPlayer,"ped","FLOOR_hit_f",-1,false)
+ triggerServerEvent("onPlayerUnconsciousAnimation",localPlayer,"unconscious",localPlayer)
toggleAllControls(false,true,true)
enableBlackWhite(true)
unbindKey("J","down",initInventory)
@@ -560,7 +602,6 @@ function setPlayerUnconscious()
if not isHourGlassActive then
addEventHandler("onClientRender",root,drawHourGlass)
isHourGlassActive = true
- --setPedAnimation(localPlayer,"ped","FLOOR_hit_f",-1,false)
triggerServerEvent("onPlayerUnconsciousAnimation",localPlayer,"unconscious",localPlayer)
toggleAllControls(false,true,true)
enableBlackWhite(true)
@@ -572,8 +613,6 @@ function setPlayerUnconscious()
if isHourGlassActive then
removeEventHandler("onClientRender",root,drawHourGlass)
isHourGlassActive = false
- --setPedAnimation(localPlayer,"ped","getup_front",-1,false)
- --setTimer(function() setPedAnimation (localPlayer,false) end,1300,1)
triggerServerEvent("onPlayerUnconsciousAnimation",localPlayer,"awake",localPlayer)
toggleAllControls(true,true,true)
enableBlackWhite(false)
@@ -594,8 +633,7 @@ function wakePlayerFromUnconsciousness()
removeEventHandler("onClientRender",root,drawHourGlass)
toggleAllControls(true,true,true)
enableBlackWhite(false)
- setPedAnimation(localPlayer,"ped","getup_front",-1,false)
- setTimer(function() setPedAnimation (localPlayer,false) end,1300,1)
+ triggerServerEvent("onPlayerUnconsciousAnimation",localPlayer,"awake",localPlayer)
bindKey("J","down",initInventory)
triggerServerEvent("bindFuncKeys",localPlayer)
startRollMessage2("Status","You are awake.",0,255,0)
@@ -610,6 +648,7 @@ setTimer(wakePlayerFromUnconsciousness,60000,0)
function removeUnconsciousHandlerOnDeath()
if getElementData(localPlayer,"isDead") then
if isHourGlassActive then
+ setElementData(localPlayer,"unconscious",false)
removeEventHandler("onClientRender",root,drawHourGlass)
toggleAllControls(true,true,true)
enableBlackWhite(false)
@@ -619,7 +658,7 @@ function removeUnconsciousHandlerOnDeath()
end
end
end
-setTimer(removeUnconsciousHandlerOnDeath,4000,0)
+addEventHandler("onClientPlayerWasted",localPlayer,removeUnconsciousHandlerOnDeath)
local hourglassrotation = 0
local w, h = guiGetScreenSize()
@@ -695,12 +734,54 @@ function getPlayerLoad()
-- Final calculation for hunger based on blood, speed and weight of all items combined
local hunger = (math.abs((((12000 - getElementData(localPlayer,"blood")) / 12000) * 5) + playerSpeed + myLoad) * 3)
playerHunger = 0
- playerHunger = math.round(playerHunger+(hunger/80),2)
+ playerHunger = playerHunger+(hunger/70)
+ --playerHunger = math.max(math.min(playerHunger,2160,0))
-- Determining the thirst decrease value by using player speed and temperature
local thirst = 2
thirst = (playerSpeed+4)*3
playerThirst = 0
- playerThirst = math.round(playerThirst+(thirst/120)*(getElementData(localPlayer,"temperature")/37),2)
+ playerThirst = playerThirst+(thirst/60)*(getElementData(localPlayer,"temperature")/37)
+ --playerThirst = math.max(math.min(playerThirst,1440,0))
+ local hungerMultiplier = 1
+ if getElementData(localPlayer,"food") > 0 then
+ if gameplayVariables["difficulty"] then
+ if gameplayVariables["difficulty"] == "normal" then
+ hungerMultiplier = 1
+ elseif gameplayVariables["difficulty"] == "veteran" then
+ hungerMultiplier = 1.5
+ elseif gameplayVariables["difficulty"] == "hardcore" then
+ hungerMultiplier = 3
+ else
+ hungerMultiplier = 1
+ end
+ else
+ hungerMultiplier = 1
+ end
+ setElementData(localPlayer,"food",getElementData(localPlayer,"food")-(playerHunger*hungerMultiplier))
+ else
+ setElementData(localPlayer,"food",0)
+ end
+
+ local thirstMultiplier = 1
+ if getElementData(localPlayer,"thirst") > 0 then
+ if gameplayVariables["difficulty"] then
+ if gameplayVariables["difficulty"] == "normal" then
+ thirstMultiplier = 1
+ elseif gameplayVariables["difficulty"] == "veteran" then
+ thirstMultiplier = 1.5
+ elseif gameplayVariables["difficulty"] == "hardcore" then
+ thirstMultiplier = 3
+ else
+ thirstMultiplier = 1
+ end
+ else
+ thirstMultiplier = 1
+ end
+ setElementData(localPlayer,"thirst",getElementData(localPlayer,"thirst")-(playerThirst*thirstMultiplier))
+ else
+ setElementData(localPlayer,"thirst",0)
+ end
+
end
end
setTimer(getPlayerLoad,60000,0)
@@ -728,7 +809,7 @@ function setPlayerHunger()
end
end
end
-setTimer(setPlayerHunger,61000,0)
+--setTimer(setPlayerHunger,61000,0)
function setPlayerThirst()
if getElementData(localPlayer,"logedin") then
@@ -753,4 +834,293 @@ function setPlayerThirst()
end
end
end
-setTimer(setPlayerThirst,61000,0)
+--setTimer(setPlayerThirst,61000,0)
+
+function getWeaponNoise(weapon)
+ for i,weapon2 in ipairs(weaponNoiseTable) do
+ if weapon == weapon2[1] then
+ return weapon2[2]
+ end
+ end
+ return 0
+end
+
+function getWeaponNoiseFactor(weapon)
+ for i,weapon2 in ipairs(weaponNoiseTable) do
+ if weapon == weapon2[1] then
+ return weapon2[3]
+ end
+ end
+ return 5
+end
+
+function setPlayerShootingLevel()
+ if getControlState("fire") then
+ local weapon = getPedWeapon(localPlayer)
+ local noise = getWeaponNoise(weapon) or 0
+ setElementData(localPlayer,"shooting",noise)
+ if shootTimer then
+ killTimer(shootTimer)
+ end
+ shootTimer = setTimer(resetPlayerShootingLevel,2000,1)
+ end
+end
+--setTimer(setPlayerShootingLevel,100,0)
+
+local playerHasShot = 0
+local shootTimer = false
+function setPlayerShootingLevel(weapon)
+ local noise = getWeaponNoise(weapon) or 0
+ playerHasShot = noise
+ if shootTimer then
+ killTimer(shootTimer)
+ end
+ shootTimer = setTimer(resetPlayerShootingLevel,1500,1)
+end
+addEventHandler("onClientPlayerWeaponFire",localPlayer,setPlayerShootingLevel)
+
+function resetPlayerShootingLevel()
+ playerHasShot = 0
+ shootTimer = false
+end
+
+-- New sound & visibility calculation
+local initialValue = 0
+
+-- returns a float number between 0 and 1, with 0 = moon and 1 = sun
+function isSunOrMoon()
+ local hours,minutes = getTime()
+ local sunOrMoon = 0
+ if hours > 12 then
+ sunOrMoon = 2-(hours/12)
+ else
+ sunOrMoon = hours/12
+ end
+ return sunOrMoon
+end
+
+-- returns a float number between 0 and 1, with 0 = no fog and 1 = fog
+function isFogOrNot()
+ local fog = getFogDistance()
+ local getFog = 0
+ if fog < 0 then
+ getFog = 1
+ else
+ getFog = 1-(fog/400)
+ end
+ return getFog
+end
+
+-- returns a float number between 0 and 1, representing moon light intensity
+function getMoonIntensity()
+ local moonIntensity = math.sin(math.pi*exports.DayZ:getMoonPhaseValue())*1
+ return moonIntensity
+end
+
+function getCurrentLightLevel()
+ local hours,minutes = getTime()
+ local weather = getWeather()
+ local moonSunLevel = isSunOrMoon()
+ local moonLightIntensity = getMoonIntensity()
+ local rain = getRainLevel()
+ local fog = isFogOrNot()
+ local cloudy = 0
+ local lightLevel = 0
+ -- Workaround for cloud density
+ if weather == 4 or weather == 7 or weather == 12 or weather == 15 then
+ cloudy = tonumber(weather)/15
+ end
+ if hours > 6 and hours < 20 then
+ moonLightIntensity = 0
+ end
+ local lightLevel = (moonSunLevel*2)+moonLightIntensity-(cloudy*0.2)-(rain*0.2)-(fog*0.5)
+ initialValue = 20+(moonSunLevel*20)
+ return lightLevel
+end
+
+-- For muffling sounds due to weather
+function getCurrentMuffleLevel()
+ local rain = getRainLevel()
+ local muffleLevel = 0
+ muffleLevel = 1-(rain*0.3)
+ return muffleLevel
+end
+
+function getPlayerPoseVisibility()
+ local block, animation = getPedAnimation(localPlayer)
+ local moveState = getPedMoveState(localPlayer)
+ local scalePose = 0.9
+ local scaleMovement = 0.2
+ if block == "ped" or block == "SHOP" or block == "BEACH" then
+ scalePose = 0.14
+ scaleMovement = 0.3
+ end
+ if moveState == "crouch" or moveState == "crawl" then
+ scalePose = 0.6
+ scaleMovement = 0.2
+ end
+ return scalePose,scaleMovement
+end
+
+local terrainTable = {
+["grass"] = {9,10,11,12,13,14,15,16,17,20,80,81,82,115,116,117,118,119,120,121,122,125,146,147,148,149,150,151,152,153,160},
+["concrete"] = {4,5,7,8,34,89,127,135,136,137,138,139,144,165},
+["forest"] = {23,41,111,112,113,114,19,21,22,24,25,26,27,40,83,84,87,88,100,110,123,124,126,128,130,132,141,142,145,155,156},
+["rock"] = {18,35,36,37,69,109,154,161,6,85,101,134,140},
+}
+
+function getTerrainProperties()
+ local x,y,z = getElementPosition(localPlayer)
+ local material = getGroundMaterial(x,y,z)
+ local scale,movement = getPlayerPoseVisibility()
+ local terrainVisibility = false
+ local terrainNoise = false
+ local moveState = getPedMoveState(localPlayer)
+ for i, terrain in ipairs(terrainTable["grass"]) do
+ if terrain == material then
+ initialValue = initialValue*0.65
+ terrainVisibility = movement-0.05
+ if moveState == "sprint" then
+ terrainNoise = 28
+ elseif moveState == "jog" then
+ terrainNoise = 23
+ elseif moveState == "powerwalk" or moveState == "walk" then
+ terrainNoise = 19
+ elseif moveState == "crawl" then
+ terrainNoise = 20
+ elseif moveState == "crouch" or moveState == "stand" then
+ terrainNoise = 1
+ else
+ terrainNoise = 23
+ end
+ end
+ end
+ for i, terrain in ipairs(terrainTable["concrete"]) do
+ if terrain == material then
+ initialValue = initialValue*0.85
+ terrainVisibility = movement+0.1
+ if moveState == "sprint" then
+ terrainNoise = 28
+ elseif moveState == "jog" then
+ terrainNoise = 25
+ elseif moveState == "powerwalk" or moveState == "walk" then
+ terrainNoise = 19
+ elseif moveState == "crawl" then
+ terrainNoise = 20
+ elseif moveState == "crouch" or moveState == "stand" then
+ terrainNoise = 1
+ else
+ terrainNoise = 25
+ end
+ end
+ end
+ for i, terrain in ipairs(terrainTable["forest"]) do
+ if terrain == material then
+ initialValue = initialValue*0.5
+ terrainVisibility = movement-0.1
+ if moveState == "sprint" then
+ terrainNoise = 32
+ elseif moveState == "jog" then
+ terrainNoise = 27
+ elseif moveState == "powerwalk" or moveState == "walk" then
+ terrainNoise = 22
+ elseif moveState == "crawl" then
+ terrainNoise = 20
+ elseif moveState == "crouch" or moveState == "stand" then
+ terrainNoise = 1
+ else
+ terrainNoise = 27
+ end
+ end
+ end
+ for i, terrain in ipairs(terrainTable["rock"]) do
+ if terrain == material then
+ initialValue = initialValue*0.80
+ terrainVisibility = movement+0.05
+ if moveState == "sprint" then
+ terrainNoise = 30
+ elseif moveState == "jog" then
+ terrainNoise = 23
+ elseif moveState == "powerwalk" or moveState == "walk" then
+ terrainNoise = 19
+ elseif moveState == "crawl" then
+ terrainNoise = 20
+ elseif moveState == "crouch" or moveState == "stand" then
+ terrainNoise = 1
+ else
+ terrainNoise = 23
+ end
+ end
+ end
+ if material == 0 or material == 1 or material == 2 or material == 3 then
+ initialValue = initialValue*1.3
+ terrainVisibility = movement+0.2
+ if moveState == "sprint" then
+ terrainNoise = 30
+ elseif moveState == "jog" then
+ terrainNoise = 23
+ elseif moveState == "powerwalk" or moveState == "walk" then
+ terrainNoise = 18
+ elseif moveState == "crawl" then
+ terrainNoise = 20
+ elseif moveState == "crouch" or moveState == "stand" then
+ terrainNoise = 1
+ else
+ terrainNoise = 23
+ end
+ end
+ if not terrainVisibility then
+ terrainVisibility = 1
+ end
+ if not terrainNoise then
+ terrainNoise = 1
+ end
+ return terrainVisibility,terrainNoise,initialValue
+end
+
+function getPlayerSpeed()
+ if not isPedInVehicle(localPlayer) then
+ local speedx, speedy, speedz = getElementVelocity(localPlayer)
+ local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
+ mps = actualspeed * 50
+ else
+ playerSpeed = 20
+ end
+ playerSpeed = math.floor(mps*3.5)
+ return playerSpeed
+end
+
+--[[
+We check the chance for a zombie to detect a player based on his
+visibility and sound. The closer the player is to a zombie, the
+bigger the chance to be detected.
+]]
+function checkLOSChance(distance,value)
+ local var = math.max((value-distance),0)
+ distance = math.max(0.1,distance)
+ local maxExp = math.exp(2)*distance
+ local myExp = (math.exp(2)*var)/maxExp
+ myExp = math.min(myExp*5,100)
+ return myExp
+end
+
+-- Working the magic math
+-- Left to do: light exposure to fireplace and roadflare, is player in building?
+function getSoundAndVisibilityLevel()
+ local rain = getRainLevel()
+ local fog = isFogOrNot()
+ local moonSunLevel = isSunOrMoon()
+ local moonLightIntensity = getMoonIntensity()
+ local muffleLevel = getCurrentMuffleLevel()
+ local lightLevel = getCurrentLightLevel()
+ local scale,movement = getPlayerPoseVisibility()
+ local terrainVisibility,terrainNoise,initialValue = getTerrainProperties()
+ local playerSpeed = getPlayerSpeed()
+ totalSound = math.ceil((playerSpeed*terrainNoise*movement*muffleLevel)+playerHasShot)
+ totalVisibility = math.ceil((initialValue+(playerSpeed*3))*scale*lightLevel)*1.5
+ if isPedInVehicle(localPlayer) then
+ totalSound = 100
+ totalVisibility = 20
+ end
+ return totalSound,totalVisibility
+end
diff --git a/DayZ/handlers/players/server/consume_player.lua b/DayZ/handlers/players/server/consume_player.lua
index aa56a06..28706d8 100644
--- a/DayZ/handlers/players/server/consume_player.lua
+++ b/DayZ/handlers/players/server/consume_player.lua
@@ -129,6 +129,8 @@ function onPlayerUseMedicObject(itemName)
setElementData(playersource,"infection",false)
setElementData(playersource,itemName,getElementData(playersource,itemName)-1)
elseif itemName == "Morphine" then
+ setElementData(playersource,"fracturedArms",false)
+ setElementData(playersource,"fracturedLegs",false)
setElementData(playersource,"brokenbone",false)
setElementData(playersource,itemName,getElementData(playersource,itemName)-1)
elseif itemName == "Blood Bag" then
diff --git a/DayZ/handlers/players/server/damage_player.lua b/DayZ/handlers/players/server/damage_player.lua
index 386c90a..1b47a0d 100644
--- a/DayZ/handlers/players/server/damage_player.lua
+++ b/DayZ/handlers/players/server/damage_player.lua
@@ -145,7 +145,7 @@ addEventHandler("onElementDataChange",getRootElement(),weaponDelete)
function onPlayerChangeStatus(status,value)
if status == "humanity" then
- setElementData(source,status,getElementData(source,status)+value)
+ setElementData(source,status,getElementData(source,status)-value)
elseif status == "isInBuilding" then
setElementData(source,status,value)
end
diff --git a/DayZ/handlers/players/server/loot_player.lua b/DayZ/handlers/players/server/loot_player.lua
index 6c5a8e9..a7295dc 100644
--- a/DayZ/handlers/players/server/loot_player.lua
+++ b/DayZ/handlers/players/server/loot_player.lua
@@ -547,6 +547,18 @@ function checkPlayerClothes(itemName)
addPedClothes(source, "tshirtbobomonk", "tshirt", 0)
end
end
+ if itemName == "Helmet" then
+ removePedClothes(source,16,"helmet","helmet")
+ if getElementData(source, itemName) >= 2 then
+ addPedClothes(source,"helmet","helmet",16)
+ end
+ end
+ if itemName == "MX Helmet" then
+ removePedClothes(source,16,"moto","moto")
+ if getElementData(source, itemName) >= 2 then
+ addPedClothes(source,"moto","moto",16)
+ end
+ end
end
addEvent("checkPlayerClothes", true)
addEventHandler( "checkPlayerClothes", getRootElement(), checkPlayerClothes)
\ No newline at end of file
diff --git a/DayZ/handlers/players/server/skins_player.lua b/DayZ/handlers/players/server/skins_player.lua
index dd4daf9..c3980f9 100644
--- a/DayZ/handlers/players/server/skins_player.lua
+++ b/DayZ/handlers/players/server/skins_player.lua
@@ -438,6 +438,102 @@ function checkClothes()
else
removePedClothes(source, 0, "tshirtbobomonk", "tshirt")
end
+
+ --helmets
+ local skin61 = getElementData(source,"Helmet")
+ if skin61 >= 1 then
+ addPedClothes(source,"helmet","helmet",16)
+ else
+ removePedClothes(source,16,"helmet","helmet")
+ end
+
+ local skin62 = getElementData(source,"MX Helmet")
+ if skin62 >= 1 then
+ addPedClothes(source,"moto","moto",16)
+ else
+ removePedClothes(source,16,"moto","moto")
+ end
end
addEvent("onPlayerChangeClothes",true)
-addEventHandler("onPlayerChangeClothes",getRootElement(),checkClothes)
\ No newline at end of file
+addEventHandler("onPlayerChangeClothes",getRootElement(),checkClothes)
+
+-- OLD CLOTHING/SKIN SYSTEM
+function getSkinIDFromName(name)
+ for i,skin in ipairs(skinTable) do
+ if name == skin[1] then
+ return skin[2]
+ end
+ end
+end
+
+function getSkinNameFromID(id)
+ for i,skin in ipairs(skinTable) do
+ if id == skin[2] then
+ return skin[1]
+ end
+ end
+end
+
+function addPlayerSkin(skin)
+ if skin == "MX Helmet" or skin == "Helmet" then
+ setElementData(source,"hasHelmet",true)
+ setElementData(source,skin,getElementData(source,skin)-1)
+ return
+ end
+ local current = getElementData(source,"skin")
+ local name = getSkinNameFromID(current)
+ local id = getSkinIDFromName(skin)
+ local gender = getElementData(source,"gender")
+ if gender == "female" then
+ if id == 172 or id == 192 or id == 285 then
+ setElementData(source,skin,getElementData(source,skin)-1)
+ setElementData(source,"skin",id)
+ setElementModel(source,id)
+ triggerClientEvent(source,"refreshInventoryManual",source)
+ else
+ outputChatBox("You can't wear this!",source,255,0,0,true)
+ end
+ else
+ if id == 172 or id == 192 then
+ outputChatBox("You can't wear this!",source,255,0,0,true)
+ else
+ setElementData(source,skin,getElementData(source,skin)-1)
+ setElementData(source,"skin",id)
+ setElementModel(source,id)
+ triggerClientEvent(source,"refreshInventoryManual",source)
+ end
+ end
+end
+addEvent("onPlayerChangeSkin",true)
+addEventHandler("onPlayerChangeSkin",getRootElement(),addPlayerSkin)
+
+function checkBandit ()
+ if gameplayVariables["newclothingsystem"] then return end
+ for i, player in ipairs(getElementsByType("player")) do
+ if getElementData(player,"logedin") then
+ local current = getElementData(player,"skin")
+ if getElementData(player,"bandit") then
+ if getElementData(player,"gender") == "male" then
+ if current == 179 or current == 287 then
+ setElementModel(player,288)
+ elseif current == 73 then
+ setElementModel(player,180)
+ end
+ elseif getElementData(player,"gender") == "female" then
+ if current == 192 then
+ setElementModel(player,191)
+ elseif current == 172 then
+ setElementModel(player,211)
+ end
+ end
+ elseif getElementData(player,"humanity") == 5000 then
+ if current == 73 or current == 179 or current == 287 or current == 172 or current == 192 then
+ setElementModel(player,210)
+ end
+ else
+ setElementModel(player,current)
+ end
+ end
+ end
+end
+setTimer(checkBandit,20000,0)
\ No newline at end of file
diff --git a/DayZ/handlers/players/server/status_player.lua b/DayZ/handlers/players/server/status_player.lua
index afd85e9..6c2a222 100644
--- a/DayZ/handlers/players/server/status_player.lua
+++ b/DayZ/handlers/players/server/status_player.lua
@@ -219,7 +219,10 @@ function changePlayerBeardAndHair()
end
end
end
-setTimer(changePlayerBeardAndHair, 120000, 0)
+
+if gameplayVariables["newclothingsystem"] then
+ setTimer(changePlayerBeardAndHair, 120000, 0)
+end
function editPlayerBeardAndHair(thePlayer)
local pAliveTime = getElementData(thePlayer, "hoursalive")
diff --git a/DayZ/handlers/vehicles/server/actions_vehicles.lua b/DayZ/handlers/vehicles/server/actions_vehicles.lua
index 059d1b2..22ea36e 100644
--- a/DayZ/handlers/vehicles/server/actions_vehicles.lua
+++ b/DayZ/handlers/vehicles/server/actions_vehicles.lua
@@ -231,13 +231,38 @@ function respawnVehiclesInWater()
end
end
end
-setTimer(respawnVehiclesInWater,1800000,0)
+setTimer(respawnVehiclesInWater,gameplayVariables["watervehiclerespawn"],0)
+
+local respawnExplodedVehicleTimer = 0
+function respawnDayZVehicles(player)
+ if player then
+ if (not hasObjectPermissionTo(player,"function.banPlayer")) then
+ return --Stops players from using the respawn command
+ end
+ end
+
+for k, veh in ipairs(getElementsByType("vehicle")) do
+ if isVehicleBlown(veh) or isElementInWater(veh) then
+ if getElementModel(veh) ~= 453 or getElementModel(veh) ~= 595 or getElementModel(veh) ~= 473 then
+ local col = getElementData(veh,"parent")
+ if col then
+ id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4]
+ respawnDayZVehicle(id,x,y,z,veh,col,getElementData(col,"MAX_Slots"))
+ if isTimer(respawnExplodedVehicleTimer) then
+ killTimer(respawnExplodedVehicleTimer)
+ end
+ end
+ end
+ end
+ end
+end
+addCommandHandler ( "respawndayzvehicles", respawnDayZVehicles ) -- Respawn blown and sunken vehicles when typed.
function notifyAboutExplosion()
local col = getElementData(source,"parent")
local x1,y1,z1 = getElementPosition(source)
id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4]
- setTimer(respawnDayZVehicle,1800000,1,id,x,y,z,source,col,getElementData(col,"MAX_Slots"))
+ respawnExplodedVehicleTimer = setTimer(respawnDayZVehicle,gameplayVariables["explodedvehiclesrespawn"],1,id,x,y,z,source,col,getElementData(col,"MAX_Slots"))
setElementData(col,"deadVehicle",true)
setElementData(source,"isExploded",true)
createExplosion (x1+4,y1+1,z1,4)
@@ -245,4 +270,4 @@ function notifyAboutExplosion()
createExplosion (x1-1,y1+5,z1,4)
createExplosion (x1-4,y1,z1-2,4)
end
-addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion)
\ No newline at end of file
+addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion)
diff --git a/DayZ/handlers/world/server/weather.lua b/DayZ/handlers/world/server/weather.lua
index bf9b3e4..583b87e 100644
--- a/DayZ/handlers/world/server/weather.lua
+++ b/DayZ/handlers/world/server/weather.lua
@@ -74,7 +74,7 @@ local initializeWeather = false
local weatherRandomizer = 1800000
if not initializeWeather then
- setWeather(math.random(14,16))
+ setWeather(math.random(0,18))
initializeWeather = true
end
@@ -100,7 +100,7 @@ local weather = getWeather()
if shouldItRain > 74 then
setRainLevel(math.random())
else
- if getRainLevel() > 0 then
+ if getRainLevel() and getRainLevel() > 0 then
setRainLevel(0)
end
end
diff --git a/DayZ/handlers/zombies/client/movement_zombies.lua b/DayZ/handlers/zombies/client/movement_zombies.lua
index 171ebfd..d771b55 100644
--- a/DayZ/handlers/zombies/client/movement_zombies.lua
+++ b/DayZ/handlers/zombies/client/movement_zombies.lua
@@ -21,295 +21,6 @@ end
addEvent("onZombieMove",true)
addEventHandler("onZombieMove",getRootElement(),zombieMovement)
-function getWeaponNoise(weapon)
- for i,weapon2 in ipairs(weaponNoiseTable) do
- if weapon == weapon2[1] then
- return weapon2[2]
- end
- end
- return 0
-end
-
-function getWeaponNoiseFactor(weapon)
- for i,weapon2 in ipairs(weaponNoiseTable) do
- if weapon == weapon2[1] then
- return weapon2[3]
- end
- end
- return 5
-end
-
-function setPlayerShootingLevel()
- if getControlState("fire") then
- local weapon = getPedWeapon(localPlayer)
- local noise = getWeaponNoise(weapon) or 0
- setElementData(localPlayer,"shooting",noise)
- if shootTimer then
- killTimer(shootTimer)
- end
- shootTimer = setTimer(resetPlayerShootingLevel,2000,1)
- end
-end
---setTimer(setPlayerShootingLevel,100,0)
-
-local playerHasShot = 0
-local shootTimer = false
-function setPlayerShootingLevel(weapon)
- local noise = getWeaponNoise(weapon) or 0
- playerHasShot = noise
- if shootTimer then
- killTimer(shootTimer)
- end
- shootTimer = setTimer(resetPlayerShootingLevel,1500,1)
-end
-addEventHandler("onClientPlayerWeaponFire",localPlayer,setPlayerShootingLevel)
-
-function resetPlayerShootingLevel()
- playerHasShot = 0
- shootTimer = false
-end
-
--- New sound & visibility calculation
-local initialValue = 0
-
--- returns a float number between 0 and 1, with 0 = moon and 1 = sun
-function isSunOrMoon()
- local hours,minutes = getTime()
- local sunOrMoon = 0
- if hours > 12 then
- sunOrMoon = 2-(hours/12)
- else
- sunOrMoon = hours/12
- end
- return sunOrMoon
-end
-
--- returns a float number between 0 and 1, with 0 = no fog and 1 = fog
-function isFogOrNot()
- local fog = getFogDistance()
- local getFog = 0
- if fog < 0 then
- getFog = 1
- else
- getFog = 1-(fog/400)
- end
- return getFog
-end
-
--- returns a float number between 0 and 1, representing moon light intensity
-function getMoonIntensity()
- local moonIntensity = math.sin(math.pi*exports.DayZ:getMoonPhaseValue())*1
- return moonIntensity
-end
-
-function getCurrentLightLevel()
- local hours,minutes = getTime()
- local weather = getWeather()
- local moonSunLevel = isSunOrMoon()
- local moonLightIntensity = getMoonIntensity()
- local rain = getRainLevel()
- local fog = isFogOrNot()
- local cloudy = 0
- local lightLevel = 0
- -- Workaround for cloud density
- if weather == 4 or weather == 7 or weather == 12 or weather == 15 then
- cloudy = tonumber(weather)/15
- end
- if hours > 6 and hours < 20 then
- moonLightIntensity = 0
- end
- local lightLevel = (moonSunLevel*2)+moonLightIntensity-(cloudy*0.2)-(rain*0.2)-(fog*0.5)
- initialValue = 20+(moonSunLevel*20)
- return lightLevel
-end
-
--- For muffling sounds due to weather
-function getCurrentMuffleLevel()
- local rain = getRainLevel()
- local muffleLevel = 0
- muffleLevel = 1-(rain*0.3)
- return muffleLevel
-end
-
-function getPlayerPoseVisibility()
- local block, animation = getPedAnimation(localPlayer)
- local moveState = getPedMoveState(localPlayer)
- local scalePose = 0.9
- local scaleMovement = 0.2
- if block == "ped" or block == "SHOP" or block == "BEACH" then
- scalePose = 0.14
- scaleMovement = 0.3
- end
- if moveState == "crouch" or moveState == "crawl" then
- scalePose = 0.6
- scaleMovement = 0.2
- end
- return scalePose,scaleMovement
-end
-
-local terrainTable = {
-["grass"] = {9,10,11,12,13,14,15,16,17,20,80,81,82,115,116,117,118,119,120,121,122,125,146,147,148,149,150,151,152,153,160},
-["concrete"] = {4,5,7,8,34,89,127,135,136,137,138,139,144,165},
-["forest"] = {23,41,111,112,113,114,19,21,22,24,25,26,27,40,83,84,87,88,100,110,123,124,126,128,130,132,141,142,145,155,156},
-["rock"] = {18,35,36,37,69,109,154,161,6,85,101,134,140},
-}
-
-function getTerrainProperties()
- local x,y,z = getElementPosition(localPlayer)
- local material = getGroundMaterial(x,y,z)
- local scale,movement = getPlayerPoseVisibility()
- local terrainVisibility = false
- local terrainNoise = false
- local moveState = getPedMoveState(localPlayer)
- for i, terrain in ipairs(terrainTable["grass"]) do
- if terrain == material then
- initialValue = initialValue*0.65
- terrainVisibility = movement-0.05
- if moveState == "sprint" then
- terrainNoise = 28
- elseif moveState == "jog" then
- terrainNoise = 23
- elseif moveState == "powerwalk" or moveState == "walk" then
- terrainNoise = 19
- elseif moveState == "crawl" then
- terrainNoise = 20
- elseif moveState == "crouch" or moveState == "stand" then
- terrainNoise = 1
- else
- terrainNoise = 23
- end
- end
- end
- for i, terrain in ipairs(terrainTable["concrete"]) do
- if terrain == material then
- initialValue = initialValue*0.85
- terrainVisibility = movement+0.1
- if moveState == "sprint" then
- terrainNoise = 28
- elseif moveState == "jog" then
- terrainNoise = 25
- elseif moveState == "powerwalk" or moveState == "walk" then
- terrainNoise = 19
- elseif moveState == "crawl" then
- terrainNoise = 20
- elseif moveState == "crouch" or moveState == "stand" then
- terrainNoise = 1
- else
- terrainNoise = 25
- end
- end
- end
- for i, terrain in ipairs(terrainTable["forest"]) do
- if terrain == material then
- initialValue = initialValue*0.5
- terrainVisibility = movement-0.1
- if moveState == "sprint" then
- terrainNoise = 32
- elseif moveState == "jog" then
- terrainNoise = 27
- elseif moveState == "powerwalk" or moveState == "walk" then
- terrainNoise = 22
- elseif moveState == "crawl" then
- terrainNoise = 20
- elseif moveState == "crouch" or moveState == "stand" then
- terrainNoise = 1
- else
- terrainNoise = 27
- end
- end
- end
- for i, terrain in ipairs(terrainTable["rock"]) do
- if terrain == material then
- initialValue = initialValue*0.80
- terrainVisibility = movement+0.05
- if moveState == "sprint" then
- terrainNoise = 30
- elseif moveState == "jog" then
- terrainNoise = 23
- elseif moveState == "powerwalk" or moveState == "walk" then
- terrainNoise = 19
- elseif moveState == "crawl" then
- terrainNoise = 20
- elseif moveState == "crouch" or moveState == "stand" then
- terrainNoise = 1
- else
- terrainNoise = 23
- end
- end
- end
- if material == 0 or material == 1 or material == 2 or material == 3 then
- initialValue = initialValue*1.3
- terrainVisibility = movement+0.2
- if moveState == "sprint" then
- terrainNoise = 30
- elseif moveState == "jog" then
- terrainNoise = 23
- elseif moveState == "powerwalk" or moveState == "walk" then
- terrainNoise = 18
- elseif moveState == "crawl" then
- terrainNoise = 20
- elseif moveState == "crouch" or moveState == "stand" then
- terrainNoise = 1
- else
- terrainNoise = 23
- end
- end
- if not terrainVisibility then
- terrainVisibility = 1
- end
- if not terrainNoise then
- terrainNoise = 1
- end
- return terrainVisibility,terrainNoise,initialValue
-end
-
-function getPlayerSpeed()
- if not isPedInVehicle(localPlayer) then
- local speedx, speedy, speedz = getElementVelocity(localPlayer)
- local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
- mps = actualspeed * 50
- else
- playerSpeed = 20
- end
- playerSpeed = math.floor(mps*3.5)
- return playerSpeed
-end
-
---[[
-We check the chance for a zombie to detect a player based on his
-visibility and sound. The closer the player is to a zombie, the
-bigger the chance to be detected.
-]]
-function checkLOSChance(distance,value)
- local var = math.max((value-distance),0)
- distance = math.max(0.1,distance)
- local maxExp = math.exp(2)*distance
- local myExp = (math.exp(2)*var)/maxExp
- myExp = math.min(myExp*5,100)
- return myExp
-end
-
--- Working the magic math
--- Left to do: light exposure to fireplace and roadflare, is player in building?
-function getSoundAndVisibilityLevel()
- local rain = getRainLevel()
- local fog = isFogOrNot()
- local moonSunLevel = isSunOrMoon()
- local moonLightIntensity = getMoonIntensity()
- local muffleLevel = getCurrentMuffleLevel()
- local lightLevel = getCurrentLightLevel()
- local scale,movement = getPlayerPoseVisibility()
- local terrainVisibility,terrainNoise,initialValue = getTerrainProperties()
- local playerSpeed = getPlayerSpeed()
- totalSound = math.ceil((playerSpeed*terrainNoise*movement*muffleLevel)+playerHasShot)
- totalVisibility = math.ceil((initialValue+(playerSpeed*3))*scale*lightLevel)*1.5
- if isPedInVehicle(localPlayer) then
- totalSound = 100
- totalVisibility = 20
- end
- return totalSound,totalVisibility
-end
-
local targetBySound = false
local targetByVisibility = false
@@ -351,11 +62,11 @@ local x,y,z = getElementPosition(localPlayer)
else
if getElementData ( ped, "target" ) == localPlayer then
setElementData(ped,"target",nil)
- triggerEvent("onZombieMove",root,ped)
+ zombieMovement(ped)
end
if getElementData ( ped, "leader" ) == localPlayer then
triggerServerEvent("botStopFollow",localPlayer,ped)
- triggerEvent("onZombieMove",root,ped)
+ zombieMovement(ped)
end
end
end
@@ -380,12 +91,14 @@ end
setTimer(checkAliveZombies,5000,0)
function zombieSpawning()
- if getElementData(localPlayer,"logedin") then
- if not isPedInVehicle(localPlayer) then
- local material,hitX, hitY, hitZ = isObjectAroundPlayer2(localPlayer, 30,3)
- if material == 0 then
- local x, y, z = getElementPosition(getLocalPlayer())
- triggerServerEvent("createZomieForPlayer",getLocalPlayer(),x,y,z)
+ if not gameplayVariables["newzombiespawnsystem"] then
+ if getElementData(localPlayer,"logedin") then
+ if not isPedInVehicle(localPlayer) then
+ local material,hitX, hitY, hitZ = isObjectAroundPlayer2(localPlayer, 30,3)
+ if material == 0 or material == 1 or material == 2 or material == 3 then
+ local x, y, z = getElementPosition(getLocalPlayer())
+ triggerServerEvent("createZomieForPlayer",getLocalPlayer(),x,y,z)
+ end
end
end
end
diff --git a/DayZ/handlers/zombies/server/general_zombies.lua b/DayZ/handlers/zombies/server/general_zombies.lua
index 20dc558..34a1425 100644
--- a/DayZ/handlers/zombies/server/general_zombies.lua
+++ b/DayZ/handlers/zombies/server/general_zombies.lua
@@ -36,19 +36,26 @@ function spawnZombies(x,y,z)
local number1 = math.random(-20,20)
local number2 = math.random(-20,20)
randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) )
- zombie = call (getResourceFromName("slothbot"),"spawnBot",x+number1,y+number2,z,math.random(0,360),ZombiePedSkins[randomZskin],0,0,getTeamFromName("Zombies"))
- setElementData(zombie,"zombie",true)
+ local speedLevel = "normal"
if gameplayVariables["difficulty"] then
if gameplayVariables["difficulty"] == "normal" then
multiplier = 1
+ if math.random(0,100) <= 25 then
+ speedLevel = "sprint"
+ end
elseif gameplayVariables["difficulty"] == "veteran" then
multiplier = 1.5
+ speedLevel = "sprint"
elseif gameplayVariables["difficulty"] == "hardcore" then
multiplier = 3
+ speedLevel = "sprint"
else
multiplier = 1
+ speedLevel = "sprint"
end
end
+ zombie = call (getResourceFromName("slothbot"),"spawnBot",x+number1,y+number2,z,math.random(0,360),ZombiePedSkins[randomZskin],0,0,getTeamFromName("Zombies"),false,false,false,speedLevel)
+ setElementData(zombie,"zombie",true)
setElementData(zombie,"blood",gameplayVariables["zombieblood"]*multiplier)
setElementData(zombie,"owner",source)
call ( getResourceFromName ( "slothbot" ), "setBotGuard", zombie, x+number1,y+number2,z, false)
@@ -71,72 +78,85 @@ function spawnZombies(x,y,z)
setPedAnimation(viralzombie,"RYDER", "RYD_Die_PT1", -1, true, true, true)
end
]]
+
end
setElementData(source,"lastzombiespawnposition",{x,y,z})
setElementData(source,"spawnedzombies",getElementData(source,"spawnedzombies")+gameplayVariables["amountzombies"])
end
end
addEvent("createZomieForPlayer",true)
-addEventHandler("createZomieForPlayer",root,spawnZombies)
--[[
-Code for new global zombie spawn system
+Code for new zombie spawn system
Current Problems:
--- too laggy when zombie amount exceeds a certain number (> 100 zombies)
--- zombies can't be killed
-
+-- TO DO: Add max limit per client
+--]]
local ZedCounter = 0
-function spawnZombies(x,y,z)
- for i, pos in ipairs(ZombieSpawnPositions) do
- local viralzombierand = math.random(0,50)
- for i = 1, 2 do --gameplayVariables["amountzombies"]
- local number1 = math.random(-20,20)
- local number2 = math.random(-20,20)
- randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) )
- zombie = call (getResourceFromName("slothbot"),"spawnBot",pos[1]+number1,pos[2]+number2,pos[3],math.random(0,360),ZombiePedSkins[randomZskin],0,0,getTeamFromName("Zombies"))
- setElementData(zombie,"zombie",true)
- if gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "normal" then
- multiplier = 1
- elseif gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "veteran" then
- multiplier = 1.5
- elseif gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "hardcore" then
- multiplier = 3
- else
- multiplier = 1
- end
- setElementData(zombie,"blood",gameplayVariables["zombieblood"]*multiplier)
- setElementData(zombie,"owner",source)
- call ( getResourceFromName ( "slothbot" ), "setBotGuard", zombie, pos[1]+number1,pos[2]+number2,pos[3], false)
- setPedAnimation (zombie, "RYDER", "RYD_Die_PT1", -1, true, true, true)
- if viralzombierand >= 1 and viralzombierand <= 25 then
- viralzombie = call(getResourceFromName("slothbot"),"spawnBot",pos[1]+number1,pos[2]+number2,pos[3]+0.1,math.random(0,360),206,0,0,getTeamFromName("Zombies"))
- setElementData(viralzombie,"zombie",true)
- setElementData(viralzombie,"viralzombie",true)
- if gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "normal" then
- multiplier = 1
- elseif gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "veteran" then
- multiplier = 1.5
- elseif gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "hardcore" then
- multiplier = 3
- else
- multiplier = 1
+local colsphereID = 0
+local newColSphereID = 0
+local ZedSphereCounter = 0
+function spawnZombiesCol(hitElement)
+ if not getElementData(source,"isZombieSpawn") then return end
+ if getElementData(hitElement,"zombie") then return end
+ if ZedCounter >= gameplayVariables["maxzombiesglobal"] then
+ return
+ end
+ local x,y,z = getElementPosition(source)
+ colsphereID = getElementData(source,"colsphereZedID")
+ if colsphereID == newColSphereID then
+ return
+ end
+ local buildingClass = getElementData(source,"parent")
+ for i, chance in pairs(zombieBuildingSpawn) do
+ if buildingClass == chance[1] then
+ if math.random() < chance[2] then
+ for i=1, gameplayVariables["maxzombiesperloot"] do
+ local number1 = math.random(-gameplayVariables["zombiespawnradius"],gameplayVariables["zombiespawnradius"])
+ local number2 = math.random(-gameplayVariables["zombiespawnradius"],gameplayVariables["zombiespawnradius"])
+ randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) )
+ local speedLevel = "normal"
+ if gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "normal" then
+ multiplier = 1
+ if math.random(0,100) <= 25 then
+ speedLevel = "sprint"
+ end
+ elseif gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "veteran" then
+ multiplier = 1.5
+ speedLevel = "sprint"
+ elseif gameplayVariables["difficulty"] and gameplayVariables["difficulty"] == "hardcore" then
+ multiplier = 3
+ speedLevel = "sprint"
+ else
+ multiplier = 1
+ speedLevel = "sprint"
+ end
+ zombie = call (getResourceFromName("slothbot"),"spawnBot",x+number1,y+number2,z+0.3,math.random(0,360),ZombiePedSkins[randomZskin],0,0,getTeamFromName("Zombies"),false,false,false,speedLevel)
+ setElementData(zombie,"zombie",true)
+ setElementData(zombie,"blood",gameplayVariables["zombieblood"]*multiplier)
+ setElementData(zombie,"owner",source)
+ call ( getResourceFromName ( "slothbot" ), "setBotGuard", zombie, x+number1,y+number2,z, false)
+ setPedAnimation (zombie, "RYDER", "RYD_Die_PT1", -1, true, true, true)
+ ZedCounter = ZedCounter+1
+ ZedSphereCounter = ZedSphereCounter+1
+ -- outputServerLog("Zombies spawned: "..tostring(ZedCounter)) -- Debug
end
- setElementData(viralzombie,"blood",24000*multiplier)
- setElementData(viralzombie,"owner",source)
- setPedAnimation(viralzombie,"RYDER", "RYD_Die_PT1", -1, true, true, true)
- end
+ end
end
- ZedCounter = ZedCounter+i
- outputServerLog("Zombies spawned: "..tostring(ZedCounter))
- if ZedCounter >= gameplayVariables["maxzombiesglobal"] then outputServerLog("ZedCounter is higher than the variable") break end
end
- --setElementData(source,"lastzombiespawnposition",{x,y,z})
- --setElementData(source,"spawnedzombies",getElementData(source,"spawnedzombies")+gameplayVariables["amountzombies"])
+ colsphereID = getElementData(source,"colsphereZedID")
+ newColSphereID = colsphereID
end
-addEventHandler("onResourceStart",resourceRoot,spawnZombies)
-]]
+
+function determineZombieSpawnSystem()
+ if gameplayVariables["newzombiespawnsystem"] then
+ addEventHandler("onColShapeHit",root,spawnZombiesCol)
+ else
+ addEventHandler("createZomieForPlayer",root,spawnZombies)
+ end
+end
+addEventHandler("onResourceStart",resourceRoot,determineZombieSpawnSystem)
function controlZombieSpawning()
for i,ped in ipairs(getElementsByType("ped")) do
@@ -149,18 +169,22 @@ function controlZombieSpawning()
setElementData ( ped, "leader", nil )
destroyElement(ped)
goReturn = true
+ ZedCounter = math.max((ZedCounter-1),0)
end
if not goReturn then
local x,y,z = getElementPosition(getElementData(ped,"owner"))
local Zx,Zy,Zz = getElementPosition(ped)
if getDistanceBetweenPoints3D (x,y,z,Zx,Zy,Zz) > 60 then
- if getElementData(zombieCreator,"spawnedzombies")-1 >= 0 then
- setElementData(zombieCreator,"spawnedzombies",getElementData(zombieCreator,"spawnedzombies")-1)
- end
+ if not gameplayVariables["newzombiespawnsystem"] then
+ if getElementData(zombieCreator,"spawnedzombies")-1 >= 0 then
+ setElementData(zombieCreator,"spawnedzombies",getElementData(zombieCreator,"spawnedzombies")-1)
+ end
+ end
setElementData ( ped, "status", "dead" )
setElementData ( ped, "target", nil )
setElementData ( ped, "leader", nil )
destroyElement(ped)
+ ZedCounter = math.max((ZedCounter-1),0)
end
end
end
@@ -169,7 +193,7 @@ end
setTimer(controlZombieSpawning,20000,0)
function botAttack(ped)
- if ped then
+ if isElement(ped) then
setPedAnimation(ped,false)
end
call ( getResourceFromName ( "slothbot" ), "setBotFollow", ped, source)
diff --git a/DayZ/handlers/zombies/server/kill_zombies.lua b/DayZ/handlers/zombies/server/kill_zombies.lua
index e3ba857..6937863 100644
--- a/DayZ/handlers/zombies/server/kill_zombies.lua
+++ b/DayZ/handlers/zombies/server/kill_zombies.lua
@@ -14,15 +14,13 @@ function destroyDeadZombie (ped,pedCol)
end
function killZombie(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,360000 ,1,ped,pedCol)
+
attachElements (pedCol,ped,0,0,0)
setElementData(pedCol,"parent",ped)
setElementData(pedCol,"playername","Zombie")
@@ -30,6 +28,9 @@ function killZombie(killer,headshot)
setElementData(ped,"deadzombie",true)
setElementData(pedCol,"deadman",true)
setElementData(pedCol,"MAX_Slots",12)
+ if killer then
+ setElementData(killer,"zombieskilled",getElementData(killer,"zombieskilled")+1)
+ end
local hours,minutes = getTime()
local loot_table = ""
setElementData(pedCol,"deadreason","Looks like it's finally dead. Estimated time of death: "..hours..":"..minutes)
@@ -47,7 +48,9 @@ function killZombie(killer,headshot)
end
end
local zombieCreator = getElementData(source,"owner")
- setElementData(zombieCreator,"spawnedzombies",getElementData(zombieCreator,"spawnedzombies")-1)
+ if not gameplayVariables["newzombiespawnsystem"] then
+ setElementData(zombieCreator,"spawnedzombies",getElementData(zombieCreator,"spawnedzombies")-1)
+ end
destroyElement(source)
if headshot then
setElementData(killer,"headshots",getElementData(killer,"headshots")+1)
diff --git a/DayZ/init/loot/other_loot.lua b/DayZ/init/loot/other_loot.lua
index 968924d..8e09750 100644
--- a/DayZ/init/loot/other_loot.lua
+++ b/DayZ/init/loot/other_loot.lua
@@ -70,17 +70,19 @@ hospitalCol = {}
function createHospitalPacks()
number1 = 0
for i,box in ipairs(hospitalPacks) do
- number1 = number1+1
- local x,y,z = box[1],box[2],box[3]
- object = createObject(1558,x,y,z-0.3,nil,nil,nil)
- setObjectScale(object,3)
- hospitalCol[i] = createColSphere(x,y,z,2)
- setElementData(hospitalCol[i],"parent",object)
- setElementData(hospitalCol[i],"hospitalbox",true)
- setElementData(hospitalCol[i],"MAX_Slots",40)
- for _,items in ipairs(otherLootItems["hospital"]) do
- setElementData(hospitalCol[i],items[1],items[5])
- end
+ if 0.4 > math.random() then
+ number1 = number1+1
+ local x,y,z = box[1],box[2],box[3]
+ object = createObject(1558,x,y,z-0.3,nil,nil,nil)
+ setObjectScale(object,3)
+ hospitalCol[i] = createColSphere(x,y,z,2)
+ setElementData(hospitalCol[i],"parent",object)
+ setElementData(hospitalCol[i],"hospitalbox",true)
+ setElementData(hospitalCol[i],"MAX_Slots",40)
+ for _,items in ipairs(otherLootItems["hospital"]) do
+ setElementData(hospitalCol[i],items[1],items[5])
+ end
+ end
end
setTimer(updateHospitals,3600000,1)
end
\ No newline at end of file
diff --git a/DayZ/init/loot/world_loot.lua b/DayZ/init/loot/world_loot.lua
index cc69cba..8114c4d 100644
--- a/DayZ/init/loot/world_loot.lua
+++ b/DayZ/init/loot/world_loot.lua
@@ -46,25 +46,42 @@ function createItemPickup(item,x,y,z,tableStringName)
end
end
+local ZedCounter = 0
function createItemLoot (lootPlace,x,y,z,id)
- col = createColSphere(x,y,z,1.25)
- setElementData(col,"itemloot",true)
- setElementData(col,"parent",lootPlace)
- setElementData(col,"MAX_Slots",20)
+ ZedCounter = ZedCounter+1
+ lootCol = createColSphere(x,y,z,1.25)
+ setElementData(lootCol,"itemloot",true)
+ setElementData(lootCol,"parent",lootPlace)
+ setElementData(lootCol,"MAX_Slots",20)
+ if gameplayVariables["newzombiespawnsystem"] then
+ zombieSpawnCol = createColSphere(x,y,z,gameplayVariables["zombiespawnradius"])
+ setElementData(zombieSpawnCol,"isZombieSpawn",true)
+ setElementData(zombieSpawnCol,"parent",lootPlace)
+ setElementData(zombieSpawnCol,"colsphereZedID",ZedCounter)
+ end
--Items
for i, item in ipairs(buildingClasses[lootPlace]) do
- local value = math.percentChance(item[5],math.random(2,5))
- setElementData(col,item[1],value)
+ local value = math.percentChance(item[5],math.random(2,5))
+ if gameplayVariables["newclothingsystem"] then
+ if item[1] == "Survivor Clothing" or item[1] == "Survivor Clothing (Female)" or item[1] == "Camouflage Clothing" or item[1] == "Ghillie Suit" or item[1] == "Civilian Clothing" or item[1] == "Civilian Clothing (Female)" then
+ value = 0
+ end
+ else
+ if item[1] == "Military collar" or item[1] == "Africa collar" or item[1] == "LS collar" or item[1] == "Gold collar" or item[1] == "Silver collar" or item[1] == "Black Bandana (M)" or item[1] == "Blue Bandana (M)" or item[1] == "Green Bandana (M)" or item[1] == "Red Bandana (M)" or item[1] == "Dark Glasses" or item[1] == "Red Glasses" or item[1] == "Square Glasses" or item[1] == "Black Bandana (H)" or item[1] == "Blue Bandana (H)" or item[1] == "Green Bandana (H)" or item[1] == "Red Bandana (H)" or item[1] == "Black Beret" or item[1] == "Red Beret" or item[1] == "Old Hat" or item[1] == "Black Hat" or item[1] == "Yellow Hat" or item[1] == "Black Trucker" or item[1] == "Blue Trucker" or item[1] == "Green Trucker" or item[1] == "Red Trucker" or item[1] == "Yellow Trucker" or item[1] == "Cow-Boy Hat" or item[1] == "White Hat" or item[1] == "Hockey Mask" or item[1] == "Black Shoe" or item[1] == "Sport Shoe" or item[1] == "Brown Shoe" or item[1] == "Biker Shoe" or item[1] == "Blue Shoe" or item[1] == "Red Shoe" or item[1] == "Beach Shoe" or item[1] == "Black Pants" or item[1] == "Beige Pants" or item[1] == "Gray Shorts" or item[1] == "Blue Shorts" or item[1] == "Blue Jeans" or item[1] == "Green Jeans" or item[1] == "Gray Pants" or item[1] == "Yellow Pants" or item[1] == "Blue Jogging" or item[1] == "Gray Jogging" or item[1] == "Military Pants" or item[1] == "Beige Vest" or item[1] == "Baseball Shirt" or item[1] == "Baseball 2 Shirt" or item[1] == "Red Vest" or item[1] == "Grey Shirt" or item[1] == "Green Vest" or item[1] == "Hawai Shirt" or item[1] == "Black Vest" or item[1] == "Brown Vest" or item[1] == "Biker Vest" or item[1] == "Blue Shirt" or item[1] == "Green 2 Vest" or item[1] == "Number 5 Shirt" or item[1] == "Monk Shirt" or item[1] == "Helmet" or item[1] == "MX Helmet" then
+ value = 0
+ end
+ end
+ setElementData(lootCol,item[1],value)
--weapon Ammo
local ammoData,weapID = getWeaponAmmoFromName (item[1],true)
if ammoData and value > 0 then
- setElementData(col,ammoData,math.random(0,3))
+ setElementData(lootCol,ammoData,math.random(0,3))
end
end
--itemLoot
- refreshItemLoot (col,lootPlace)
+ refreshItemLoot (lootCol,lootPlace)
- return col
+ return lootCol
end
function refreshItemLoot (col,place)
@@ -151,8 +168,10 @@ end
function createPickupsOnServerStart()
iPickup = 0
async:foreach(pickupPositions["residential"], function(pos)
- iPickup = iPickup + 1
- createItemLoot("Residential", pos[1], pos[2], pos[3], iPickup)
+ if 0.5 > math.random() then
+ iPickup = iPickup + 1
+ createItemLoot("Residential", pos[1], pos[2], pos[3], iPickup)
+ end
end)
setTimer(createPickupsOnServerStart2, 60000, 1)
end
@@ -185,8 +204,10 @@ end
function createPickupsOnServerStart2()
for i,pos in ipairs(pickupPositions["industrial"]) do
- iPickup = iPickup + 1
- createItemLoot("Industrial",pos[1],pos[2],pos[3],iPickup)
+ if 0.3 > math.random() then
+ iPickup = iPickup + 1
+ createItemLoot("Industrial",pos[1],pos[2],pos[3],iPickup)
+ end
end
setTimer(createPickupsOnServerStart3,60000,1)
end
@@ -206,8 +227,10 @@ end
function createPickupsOnServerStart3()
for i,pos in ipairs(pickupPositions["farm"]) do
- iPickup = iPickup + 1
- createItemLoot("Farm",pos[1],pos[2],pos[3],iPickup)
+ if 0.5 > math.random() then
+ iPickup = iPickup + 1
+ createItemLoot("Farm",pos[1],pos[2],pos[3],iPickup)
+ end
end
setTimer(createPickupsOnServerStart4,60000,1)
end
@@ -230,8 +253,10 @@ end
function createPickupsOnServerStart4()
for i,pos in ipairs(pickupPositions["supermarket"]) do
- iPickup = iPickup + 1
- createItemLoot("Supermarket",pos[1],pos[2],pos[3],iPickup)
+ if 0.4 > math.random() then
+ iPickup = iPickup + 1
+ createItemLoot("Supermarket",pos[1],pos[2],pos[3],iPickup)
+ end
end
setTimer(createPickupsOnServerStart5,60000,1)
end
@@ -253,8 +278,10 @@ end
function createPickupsOnServerStart5()
for i,pos in ipairs(pickupPositions["military"]) do
- iPickup = iPickup + 1
- createItemLoot("Military",pos[1],pos[2],pos[3],iPickup)
+ if 0.4 > math.random() then
+ iPickup = iPickup + 1
+ createItemLoot("Military",pos[1],pos[2],pos[3],iPickup)
+ end
end
end
diff --git a/DayZ/init/players/login_init.lua b/DayZ/init/players/login_init.lua
index faa79e1..0b3360f 100644
--- a/DayZ/init/players/login_init.lua
+++ b/DayZ/init/players/login_init.lua
@@ -7,7 +7,7 @@
----* Type: SERVER *----
#-----------------------------------------------------------------------------#
]]
-
+something = {} -- Secret thing
local sDataNames = { --Add your elementdata's here for them to be saved.
["brokenbone"] = {false},
["unconscious"] = {false},
@@ -21,25 +21,94 @@ local sDataNames = { --Add your elementdata's here for them to be saved.
["currentweapon_2"] = {false},
["currentweapon_3"] = {false},
["bandit"] = {false},
+ ["skin"] = {0},
["achievements"] = {}
}
+local dbConnection
+if gameplayVariables["MySQL"] then
+ dbConnection = dbConnect( "mysql", "dbname="..gameplayVariables["MySQL_DB"]..";host="..gameplayVariables["MySQL_host"]..";port="..gameplayVariables["MySQL_port"], gameplayVariables["MySQL_user"], gameplayVariables["MySQL_pass"], "share=1" )
+ dbExec(dbConnection,"CREATE TABLE IF NOT EXISTS `accounts` (`ID` int(11) NOT NULL AUTO_INCREMENT,`username` text NOT NULL,`password` text NOT NULL,`userdata` text NOT NULL, `rank` text NOT NULL, `creationDate` text NOT NULL,`lastLogin` text NOT NULL, PRIMARY KEY (`ID`))")
+end
function playerLogin(username, pass, player)
if client then player = client end
- account = getPlayerAccount(player)
- local playerID = getAccountData(account,"playerID")
- local x,y,z = getAccountData(account,"last_x"),getAccountData(account,"last_y"),getAccountData(account,"last_z")
- local skin = getAccountData(account,"skin")
- --local weight = getAccountData(account, "player.weight")
- local hoursalive = getAccountData(account, "player.hoursalive")
- setElementData(player, "hoursalive", hoursalive)
- --setPedStat(player, 21, weight)
-
+ local playerID,x,y,z,skin,hoursalive,isAdmin,isSupporter;
setElementData(player,"spawnedzombies",0)
- if getAccountData(account,"isDead") then
- spawnDayZPlayer(player)
- return
+ if gameplayVariables["MySQL"] then
+ something[player] = username
+ account = username
+ local qh = dbQuery(dbConnection, "SELECT * FROM accounts WHERE `username`=? LIMIT 1",account)
+ local result = dbPoll(qh, -1)
+ local tableE = {}
+ for i, row in ipairs(result) do
+ tableE = fromJSON(row["userdata"])
+ playerID = row["ID"]
+ end
+ x,y,z = tableE["last_x"] or 0, tableE["last_y"] or 0, tableE["last_z"] or 0
+ skin = tableE["skin"]
+ hoursalive = tableE["hoursalive"]
+ for i,data in ipairs(playerDataTable) do
+ local elementData = tableE[data[1]]
+ --outputChatBox(tostring(elementData))
+ if not elementData then
+ if sDataNames[data[1]] then
+ elementData = sDataNames[data[1]][1] --Grabs default value for these from sDataNames
+ else
+ elementData = 0
+ end
+ end
+ setElementData(player,data[1],elementData)
+ end
+ if tableE["isDead"] then
+ spawnDayZPlayer(player)
+ return
+ end
+ if tableE["rank"] == "Admin" then
+ isAdmin = true
+ else
+ isAdmin = false -- to avoid chance of bug
+ end
+ if tableE["rank"] == "Supporter" then
+ isSupporter = true
+ else
+ isSupporter = false -- to avoid chance of bug
+ end
+ else
+ account = getPlayerAccount(player)
+ playerID = getAccountData(account,"playerID")
+ x,y,z = getAccountData(account,"last_x")or 0,getAccountData(account,"last_y")or 0,getAccountData(account,"last_z")or 0
+ skin = getAccountData(account,"skin")
+ hoursalive = getAccountData(account, "player.hoursalive")
+ for i,data in ipairs(playerDataTable) do
+ local elementData = getAccountData(account,data[1])
+ if not elementData then
+ if sDataNames[data[1]] then
+ elementData = sDataNames[data[1]][1] --Grabs default value for these from sDataNames
+ else
+ elementData = 0
+ end
+ end
+ setElementData(player,data[1],elementData)
+ end
+ isAdmin = getAccountData(account,"admin") or false
+ isSupporter = getAccountData(account,"supporter") or false
+ if getAccountData(account,"isDead") then
+ spawnDayZPlayer(player)
+ return
+ end
+ end
+ if not skin then
+ if not gameplayVariables["newclothingsystem"] then
+ skin = 73
+ end
+ else
+ if not gameplayVariables["newclothingsystem"] then
+ if skin == 0 then
+ skin = 73
+ end
+ end
end
+ setElementData(player, "hoursalive", hoursalive)
spawnPlayer (player, x,y,z+0.5, math.random(0,360), skin, 0, 0)
setElementFrozen(player, true)
fadeCamera (player, false,2000,0,0,0)
@@ -52,31 +121,19 @@ function playerLogin(username, pass, player)
end,500,1,player)
playerCol = createColSphere(x,y,z,1.5)
setElementData(player,"playerCol",playerCol)
- attachElements ( playerCol, player, 0, 0, 0 )
+ 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])
- if not elementData then
- if sDataNames[data[1]] then
- elementData = sDataNames[data[1]][1] --Grabs default value for these from sDataNames
- else
- elementData = 0
- end
- end
- setElementData(player,data[1],elementData)
- end
-
+
if not getElementData(player,"bloodtype") then
determineBloodType(player)
setElementData(player,"bloodtypediscovered","?")
end
-
setElementData(player,"logedin",true)
- triggerEvent("onPlayerChangeClothes", player)
- --Weapons
- --Old Weapons
+ setElementData(player,"gender","male")
+ if gameplayVariables["newclothingsystem"] then
+ triggerEvent("onPlayerChangeClothes", player)
+ end
local weapon = getElementData(player,"currentweapon_1")
if weapon then
local ammoData,weapID = getWeaponAmmoFromName (weapon)
@@ -92,10 +149,19 @@ function playerLogin(username, pass, player)
local ammoData,weapID = getWeaponAmmoFromName (weapon)
giveWeapon(player,weapID,getElementData(player,ammoData), false )
end
- setElementModel(player, getElementData(player,"skin"))
-
- setElementData(player,"admin",getAccountData(account,"admin") or false)
- setElementData(player,"supporter",getAccountData(account,"supporter") or false)
+ if gameplayVariables["newclothingsystem"] then
+ setElementModel(player,0)
+ setElementData(player,"skin",0)
+ else
+ if getElementModel(player) == 0 or getElementData(player,"skin") == 0 or skin == 0 then
+ setElementModel(player,73)
+ setElementData(player,"skin",73)
+ else
+ setElementModel(player, getElementData(player,"skin"))
+ end
+ end
+ setElementData(player,"admin",isAdmin)
+ setElementData(player,"supporter",isSupporter)
triggerClientEvent(player, "onClientPlayerDayZLogin", player)
end
addEvent("onPlayerDayZLogin", true)
@@ -103,14 +169,16 @@ addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin)
function playerRegister(username, pass, player)
if client then player = client end
+ something[player] = username
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), skin, 0, 0)
+ x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3]
+ if not gameplayVariables["newclothingsystem"] then
+ skin = 73
+ end
+ spawnPlayer(player,x,y,z, math.random(0,360), skin, 0, 0)
fadeCamera (player, false,2000,0,0,0)
setCameraTarget (player, player)
setElementData(player, "hoursalive", 0)
-
setTimer( function(player)
if isElement(player) then
setElementFrozen(player, false)
@@ -122,73 +190,181 @@ function playerRegister(username, pass, player)
attachElements ( playerCol, player, 0, 0, 0 )
setElementData(playerCol,"parent",player)
setElementData(playerCol,"player",true)
- setPedStat(player, 21, math.random(200,400))
- ----------------------------------
- --Player Items on Start
for i,data in ipairs(playerDataTable) do
if data[1] == "bloodtype" then
determineBloodType(player)
+ elseif data[1] == "skin" then
+ if not gameplayVariables["newclothingsystem"] then
+ setElementData(player,"skin",73)
+ end
else
setElementData(player,data[1],data[2])
end
- end
- account = getAccount(username)
- local value = getAccounts()
- local value = #value
- setElementData(player,"playerID",value+1)
- setAccountData(account,"playerID",value+1)
+ end
+ if gameplayVariables["newclothingsystem"] then
+ for i,clothes in ipairs(clothesTable["Collar"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 11 then
+ local randomCloth = clothes[math.random(#clothesTable["Collar"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Head"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 26 then
+ local randomCloth = clothes[math.random(#clothesTable["Head"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Feet"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 95 then
+ local randomCloth = clothes[math.random(#clothesTable["Feet"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Legs"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 95 then
+ local randomCloth = clothes[math.random(#clothesTable["Legs"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Torso"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 95 then
+ local randomCloth = clothes[math.random(#clothesTable["Torso"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Eyes"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 11 then
+ local randomCloth = clothes[math.random(#clothesTable["Eyes"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ end
+ if not gameplayVariables["MySQL"] then
+ account = getAccount(username)
+ local value = getAccounts()
+ local value = #value
+ setElementData(player,"playerID",value+1)
+ setAccountData(account,"playerID",value+1)
+ end
setElementData(player,"logedin",true)
+ setElementData(player,"gender","male")
setElementData(player,"spawnedzombies",0)
- triggerEvent("onPlayerChangeClothes", player)
+ if gameplayVariables["newclothingsystem"] then
+ triggerEvent("onPlayerChangeClothes", player)
+ end
end
addEvent("onPlayerDayZRegister", true)
addEventHandler("onPlayerDayZRegister", getRootElement(), playerRegister)
function savePlayerAccount() -- Save in the database
- local account = getPlayerAccount(source)
- if account then
- for i,data in ipairs(playerDataTable) do
- setAccountData(account,data[1],getElementData(source,data[1]))
- end
- local x,y,z = getElementPosition(source)
- local weight = getPedStat(source, 21) or 0
- local hoursalive = getElementData(source, "hoursalive")
- setAccountData(account,"last_x",x)
- setAccountData(account,"last_y",y)
- setAccountData(account,"last_z",z)
- setAccountData(account, "player.weight", weight)
- setAccountData(account, "hoursalive", hoursalive)
- if getElementData(source,"logedin") then
- destroyElement(getElementData(source,"playerCol"))
- end
- if getElementData(source,"sepsis") == 4 then
- setAccountData(account,"infection",true)
- end
- end
- setElementData(source,"logedin",false)
- outputServerLog("[DayZ] Player account "..getAccountName(account).." has been saved.")
-end
-addEventHandler ( "onPlayerQuit", getRootElement(), savePlayerAccount)
-
-function saveAllAccounts() -- Save in the database
- for i, player in ipairs(getElementsByType("player")) do
- local account = getPlayerAccount(player)
+ local x,y,z = getElementPosition(source)
+ local weight = getPedStat(source, 21) or 0
+ local hoursalive = getElementData(source, "hoursalive")
+ if gameplayVariables["MySQL"] then
+ local account = something[source]
if account then
+ local tbl = {}
for i,data in ipairs(playerDataTable) do
- setAccountData(account,data[1],getElementData(player,data[1]))
+ tbl[data[1]] = getElementData(source,data[1])
+ --tbl[data[1]] = getElementData(player,data[1])
+ end
+ tbl["hoursalive"] = getElementData(source,"hoursalive") or 0
+ tbl["last_x"] = x
+ tbl["last_y"] = y
+ tbl["last_z"] = z
+ tbl["player.weight"] = weight
+ tbl["isDead"] = getElementData(source,"isDead")
+ dbExec(dbConnection,"UPDATE accounts SET `userdata`=? WHERE `username`=?",toJSON(tbl),account)
+ end
+ outputServerLog("[DayZ] Player account "..account.." has been saved.")
+ else
+ local account = getPlayerAccount(source)
+ if account then
+ for i,data in ipairs(playerDataTable) do
+ setAccountData(account,data[1],getElementData(source,data[1]))
end
- local x,y,z = getElementPosition(player)
- local weight = getPedStat(player, 21) or 0
- local hoursalive = getElementData(player, "hoursalive")
setAccountData(account,"last_x",x)
setAccountData(account,"last_y",y)
setAccountData(account,"last_z",z)
setAccountData(account, "player.weight", weight)
setAccountData(account, "hoursalive", hoursalive)
- if getElementData(player,"sepsis") == 4 then
+ if getElementData(source,"sepsis") == 4 then
setAccountData(account,"infection",true)
end
end
+ outputServerLog("[DayZ] Player account "..getAccountName(account).." has been saved.")
+ end
+ if getElementData(source,"logedin") then
+ destroyElement(getElementData(source,"playerCol"))
+ end
+ setElementData(source,"logedin",false)
+end
+addEventHandler ( "onPlayerQuit", getRootElement(), savePlayerAccount)
+
+function saveAllAccounts() -- Save in the database
+ for i, player in ipairs(getElementsByType("player")) do
+ local x,y,z = getElementPosition(player)
+ local weight = getPedStat(player, 21) or 0
+ local hoursalive = getElementData(player, "hoursalive")
+ if gameplayVariables["MySQL"] then
+ local account = something[player]
+ if account then
+ local tbl = {}
+ for i,data in ipairs(playerDataTable) do
+ tbl[data[1]] = getElementData(player,data[1])
+ --tbl[data[1]] = getElementData(player,data[1])
+ end
+ tbl["hoursalive"] = getElementData(player,"hoursalive") or 0
+ tbl["last_x"] = x
+ tbl["last_y"] = y
+ tbl["last_z"] = z
+ tbl["player.weight"] = weight
+ tbl["isDead"] = getElementData(player,"isDead")
+ if getElementData(player,"sepsis") == 4 then
+ tbl["infection"] = true
+ end
+ dbExec(dbConnection,"UPDATE accounts SET `userdata`=? WHERE `username`=?",toJSON(tbl),account)
+ end
+ else
+ local account = getPlayerAccount(player)
+ if account then
+ for i,data in ipairs(playerDataTable) do
+ setAccountData(account,data[1],getElementData(player,data[1]))
+ end
+ setAccountData(account,"last_x",x)
+ setAccountData(account,"last_y",y)
+ setAccountData(account,"last_z",z)
+ setAccountData(account, "player.weight", weight)
+ setAccountData(account, "hoursalive", hoursalive)
+ if getElementData(player,"sepsis") == 4 then
+ setAccountData(account,"infection",true)
+ end
+ end
+ end
end
outputServerLog("[DayZ] All accounts have been saved.")
end
diff --git a/DayZ/init/players/spawn_init.lua b/DayZ/init/players/spawn_init.lua
index 6c0d228..fda7587 100644
--- a/DayZ/init/players/spawn_init.lua
+++ b/DayZ/init/players/spawn_init.lua
@@ -8,48 +8,140 @@
#-----------------------------------------------------------------------------#
]]
+spawnX,spawnY,spawnZ = 0,0,0
+spawnSelected = false
+function onSpawnSelectionEnabled(x,y,z)
+ spawnX = x
+ spawnY = y
+ spawnZ = z
+ spawnSelected = true
+ spawnDayZPlayer(source)
+end
+addEvent("onSpawnSelectionEnabled",true)
+addEventHandler("onSpawnSelectionEnabled",root,onSpawnSelectionEnabled)
+
function spawnDayZPlayer(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), skin, 0, 0)
- setElementFrozen(player, true)
- fadeCamera (player, true)
- setCameraTarget (player)
- setTimer( function(player)
- if isElement(player) then
- setElementFrozen(player, false)
+ if not gameplayVariables["spawnselection"] then
+ local number = math.random(table.size(spawnPositions))
+ spawnX,spawnY,spawnZ = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3]
+ spawnSelected = true
+ end
+ if spawnSelected then
+ if not gameplayVariables["newclothingsystem"] then
+ skin = 73
end
- end,500,1,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)
- local account = getPlayerAccount(player)
- setAccountData(account,"isDead",false)
- setElementData(player,"isDead",false)
- setElementData(player,"logedin",true)
- setElementData(player,"bleeding", 0)
- setElementData(player,"sepsis",0)
- setElementData(player,"unconscious",false)
- setElementData(player,"admin",getAccountData(account,"admin") or false)
- setElementData(player,"supporter",getAccountData(account,"supporter") or false)
- setPedStat(player, 21, math.random(200,400))
- setElementData(player, "hoursalive", 0)
-
- ----------------------------------
- --Player Items on Respawn
- for i,data in ipairs(playerDataTable) do
- if data[1] == "bloodtype" then
- determineBloodType(player)
- elseif data[1] == "achievements" then
- --
+ spawnPlayer (player, spawnX,spawnY,spawnZ, math.random(0,360), skin, 0, 0)
+ setElementFrozen(player, true)
+ fadeCamera (player, true)
+ setCameraTarget (player)
+ setTimer( function(player)
+ if isElement(player) then
+ setElementFrozen(player, false)
+ end
+ end,500,1,player)
+ playerCol = createColSphere(spawnX,spawnY,spawnZ,1.5)
+ setElementData(player,"playerCol",playerCol)
+ attachElements ( playerCol, player, 0, 0, 0 )
+ setElementData(playerCol,"parent",player)
+ setElementData(playerCol,"player",true)
+ if gameplayVariables["MySQL"] then
+ -- need to code it in MySQL
else
- setElementData(player,data[1],data[2])
+ local account = getPlayerAccount(player)
+ setAccountData(account,"isDead",false)
+ setElementData(player,"admin",getAccountData(account,"admin") or false)
+ setElementData(player,"supporter",getAccountData(account,"supporter") or false)
end
- end
- triggerEvent("onPlayerChangeClothes", player)
+ setElementData(player,"isDead",false)
+ setElementData(player,"logedin",true)
+ setElementData(player,"gender","male")
+ setElementData(player,"bleeding", 0)
+ setElementData(player,"sepsis",0)
+ setElementData(player,"unconscious",false)
+ setElementData(player, "hoursalive", 0)
+
+ ----------------------------------
+ --Player Items on Respawn
+ for i,data in ipairs(playerDataTable) do
+ if data[1] == "bloodtype" then
+ determineBloodType(player)
+ elseif data[1] == "achievements" then
+ --
+ elseif data[1] == "skin" then
+ if not gameplayVariables["newclothingsystem"] then
+ setElementData(player,"skin",73)
+ end
+ else
+ setElementData(player,data[1],data[2])
+ end
+ end
+ if gameplayVariables["newclothingsystem"] then
+ for i,clothes in ipairs(clothesTable["Collar"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 11 then
+ local randomCloth = clothes[math.random(#clothesTable["Collar"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Head"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 26 then
+ local randomCloth = clothes[math.random(#clothesTable["Head"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Feet"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 95 then
+ local randomCloth = clothes[math.random(#clothesTable["Feet"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Legs"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 95 then
+ local randomCloth = clothes[math.random(#clothesTable["Legs"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Torso"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 95 then
+ local randomCloth = clothes[math.random(#clothesTable["Torso"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ for i,clothes in ipairs(clothesTable["Eyes"]) do
+ local randomChance = math.random(0,100)
+ if randomChance < 11 then
+ local randomCloth = clothes[math.random(#clothesTable["Eyes"])]
+ if randomCloth then
+ setElementData(player,randomCloth,1)
+ break
+ end
+ end
+ end
+ end
+ end
+ if gameplayVariables["newclothingsystem"] then
+ triggerEvent("onPlayerChangeClothes", player)
+ end
+ setElementData(player,"spawnedzombies",0)
end
function killVehicleOccupantsOnExplode()
@@ -73,7 +165,22 @@ function destroyDeadPlayer (ped,pedCol)
destroyElement(tCol)
end
-function kilLDayZPlayer (killer,headshot,weapon)
+function checkBuggedAccount()
+ if gameplayVariables["newclothingsystem"] then return end
+ for i,player in ipairs(getElementsByType("player")) do
+ local account = getPlayerAccount(player)
+ if not account then return end
+ if getElementData(player,"logedin") then
+ if getElementModel(player) == 0 then
+ spawnDayZPlayer(player)
+ outputSideChat(getPlayerName(player).."'s Account was buggy and has been reset",root,255,255,255)
+ end
+ end
+ end
+end
+setTimer(checkBuggedAccount,90000,0)
+
+function kilLDayZPlayer(killer,headshot)
pedCol = false
local account = getPlayerAccount(source)
if not account then return end
@@ -105,12 +212,12 @@ function kilLDayZPlayer (killer,headshot,weapon)
else
minutes = minutes
end
- setElementData(pedCol,"deadreason"," name was "..tostring(getPlayerName(source))..", it appears they died at "..hours..":"..minutes..".")
+ setElementData(pedCol,"deadreason","His name was "..tostring(getPlayerName(source))..", it appears they died at "..hours..":"..minutes..".")
end
end
triggerClientEvent(source,"onClientPlayerDeathInfo",source)
if killer then
- setElementData(killer,"murders",getElementData(killer,"murders")+1)
+ setElementData(source,"killedBy",killer)
if getElementData(killer,"humanity") <= 0 then
setElementData(killer,"bandit",true)
end
@@ -154,9 +261,11 @@ function kilLDayZPlayer (killer,headshot,weapon)
setElementData(pedCol,data[1],plusData)
end
--Skin
- --local skinID = getElementData(source,"skin")
- --local skin = getSkinNameFromID(skinID)
- --setElementData(pedCol,skin,1)
+ if not gameplayVariables["newclothingsystem"] then
+ local skinID = getElementData(source,"skin")
+ local skin = getSkinNameFromID(skinID)
+ setElementData(pedCol,skin,1)
+ end
--Backpack
local backpackSlots = getElementData(source,"MAX_Slots")
if backpackSlots == gameplayVariables["assaultpack_slots"] then
@@ -176,11 +285,19 @@ function kilLDayZPlayer (killer,headshot,weapon)
end
end
setTimer(setElementPosition,500,1,source,6000,6000,0)
- setAccountData(account,"isDead",true)
+ if not gameplayVariables["MySQL"] then
+ setAccountData(account,"isDead",true)
+ end
setElementData(source,"isDead",true)
outputSideChat("Player "..getPlayerName(source).." was killed",root,255,255,255)
destroyElement(getElementData(source,"playerCol"))
- setTimer(spawnDayZPlayer,30000,1,source)
+ setTimer(function(source)
+ if gameplayVariables["spawnselection"] then
+ triggerClientEvent(source,"showSpawnSelectionWindow",source)
+ else
+ spawnDayZPlayer(source)
+ end
+ end,30000,1,source)
end
addEvent("kilLDayZPlayer",true)
addEventHandler("kilLDayZPlayer",getRootElement(),kilLDayZPlayer)
diff --git a/DayZ/init/players/spawnselection_init.lua b/DayZ/init/players/spawnselection_init.lua
new file mode 100644
index 0000000..4e827bd
--- /dev/null
+++ b/DayZ/init/players/spawnselection_init.lua
@@ -0,0 +1,83 @@
+--[[
+#-----------------------------------------------------------------------------#
+----* MTA DayZ: spawnselection.lua *----
+----* Original Author: Marwin W., Germany, Lower Saxony, Otterndorf *----
+
+----* This gamemode is being developed by L, CiBeR96, 1B0Y *----
+----* Type: CLIENT *----
+#-----------------------------------------------------------------------------#
+]]
+
+spawnSelection = {
+
+image = {},
+label = {},
+font = {},
+text = {"Tierra Robada","Whetstone","San Fierro","Bone County","Las Venturas","Red County","Flint County","Los Santos","Random"},
+}
+
+local spawnPointName = ""
+function initSpawnSelection()
+ spawnSelection.image[1] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, ":DayZ/gui/spawnselection/spawnselection.png", true)
+ spawnSelection.label[1] = guiCreateLabel(0.02, 0.07, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[2] = guiCreateLabel(0.02, 0.52, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[3] = guiCreateLabel(0.21, 0.37, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[4] = guiCreateLabel(0.38, 0.07, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[5] = guiCreateLabel(0.71, 0.10, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[6] = guiCreateLabel(0.51, 0.37, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[7] = guiCreateLabel(0.39, 0.68, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[8] = guiCreateLabel(0.78, 0.64, 0.19, 0.20, "", true, spawnSelection.image[1])
+ spawnSelection.label[9] = guiCreateLabel(0.00, 0.87, 0.36, 0.08, "", true, spawnSelection.image[1])
+
+ spawnSelection.font[1] = guiCreateFont(":DayZ/fonts/needhelp.ttf",30)
+
+ guiSetVisible(spawnSelection.image[1],true)
+ showCursor(true)
+ for i=1,9 do
+ guiSetFont(spawnSelection.label[i],spawnSelection.font[1])
+ guiLabelSetHorizontalAlign(spawnSelection.label[i],"center",true)
+ guiLabelSetVerticalAlign(spawnSelection.label[i],"center",true)
+ guiLabelSetColor(spawnSelection.label[i],255,0,0)
+ addEventHandler("onClientMouseEnter",spawnSelection.label[i],function() getSelectedSpawn(i) end,false)
+ addEventHandler("onClientMouseLeave",spawnSelection.label[i],function() getSelectedSpawn(i,"left") end,false)
+ addEventHandler("onClientGUIClick",spawnSelection.label[i],clickSelectedSpawn,false)
+ end
+end
+addEvent("showSpawnSelectionWindow",true)
+addEventHandler("showSpawnSelectionWindow",root,initSpawnSelection)
+
+function getSelectedSpawn(number,condition)
+ for i, spawn in ipairs(spawnSelection.text) do
+ if i == number then
+ guiSetText(spawnSelection.label[i],spawn)
+ spawnPointName = spawn
+ else
+ guiSetText(spawnSelection.label[i],"")
+ end
+ end
+ if condition == "left" then
+ for i=1,9 do
+ guiSetText(spawnSelection.label[i],"")
+ end
+ end
+end
+
+function clickSelectedSpawn(button,state)
+ if button == "left" then
+ if state == "up" then
+ local number = 0
+ local x,y,z = 0,0,0
+ if spawnPointName == "Random" then
+ number = math.random(table.size(spawnPositions))
+ x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3]
+ guiSetVisible(spawnSelection.image[1],false)
+ else
+ number = math.random(table.size(spawnPositionsSelection[spawnPointName]))
+ x,y,z = spawnPositionsSelection[spawnPointName][number][1],spawnPositionsSelection[spawnPointName][number][2],spawnPositionsSelection[spawnPointName][number][3]
+ guiSetVisible(spawnSelection.image[1],false)
+ end
+ triggerServerEvent("onSpawnSelectionEnabled",localPlayer,x,y,z)
+ showCursor(false)
+ end
+ end
+end
\ No newline at end of file
diff --git a/DayZ/init/vehicles/vehicles_init.lua b/DayZ/init/vehicles/vehicles_init.lua
index 5fa0218..e7df193 100644
--- a/DayZ/init/vehicles/vehicles_init.lua
+++ b/DayZ/init/vehicles/vehicles_init.lua
@@ -1070,9 +1070,13 @@ end
]]
function respawnDayZVehicle(id,x,y,z,veh,col,max_slots)
+ if isElement(veh) then
+ destroyElement(veh)
+ end
+ if isElement(col) then
+ destroyElement(col)
+ end
v_counter = v_counter+1
- destroyElement(veh)
- destroyElement(col)
veh = createVehicle(id,x,y,z+1)
vehCol = createColSphere(x,y,z,4)
attachElements ( vehCol, veh, 0, 0, 0 )
@@ -1097,3 +1101,31 @@ function respawnDayZVehicle(id,x,y,z,veh,col,max_slots)
setElementData(veh,"isExploded",false)
setElementData(vehCol,"deadVehicle",false)
end
+
+-- onVehicleEngineState: Pre-sets some data for onPlayerVehicleInteract to determine if the engine is already on or not
+-- As we can't correctly validate this with onVehicleEnter/Exit
+function onVehicleEngineState(vehicle,state)
+ if not vehicle then return end
+
+ setElementData(vehicle,"engine_state",state)
+end
+addEventHandler("onVehicleStartEnter",root,function(player,seat) onVehicleEngineState(source,getVehicleEngineState(source)) end)
+
+-- onPlayerVehicleInteract: Handles keeping the engine off due to a GTA bug.
+function onPlayerVehicleInteract(player,seat,state)
+ if state then
+ if (seat ~= 0) then
+ --Determine if the engine is on, otherwise don't turn the engine on for passengers (GTA engine bug?)
+ if (not getElementData(source,"engine_state")) then
+ setVehicleEngineState(source,false)
+ end
+ end
+ else
+ if (seat ~= 0) then return end
+ if (wasEventCancelled()) then return end --Prevents engine_state being invalid in the events of onVehicleEnter/Exit being cancelled.
+
+ setElementData(source,"engine_state",getVehicleEngineState(source))
+ end
+end
+addEventHandler("onVehicleEnter",root,function(player,seat) onPlayerVehicleInteract(player,seat,true) end)
+addEventHandler("onVehicleExit",root,function(player,seat) onPlayerVehicleInteract(player,seat,false) end)
\ No newline at end of file
diff --git a/DayZ/meta.xml b/DayZ/meta.xml
index 9afc7a9..43c1a2e 100644
--- a/DayZ/meta.xml
+++ b/DayZ/meta.xml
@@ -53,6 +53,7 @@
+
@@ -62,6 +63,7 @@
+
@@ -83,15 +85,6 @@
-
-
-
-
-
-
-
-
-
@@ -134,6 +127,7 @@
+
@@ -333,6 +327,7 @@
+
@@ -462,9 +457,39 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -916,6 +941,7 @@
+
@@ -976,6 +1002,7 @@
+
true
@@ -986,4 +1013,6 @@
+
+
diff --git a/DayZ/models/loadskins.lua b/DayZ/models/loadskins.lua
index 3108d40..24dd5dc 100644
--- a/DayZ/models/loadskins.lua
+++ b/DayZ/models/loadskins.lua
@@ -134,6 +134,63 @@ engineImportTXD(vehicleTXD,470)
vehicleDFF = engineLoadDFF(":DayZ/models/vehicles/dff/uaz.dff", 470)
engineReplaceModel(vehicleDFF,470)
+-- // Player Skins // --
+-- Standard (Male)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/standard_male.txd")
+engineImportTXD(snipertxd, 73)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/standard_male.dff", 73)
+engineReplaceModel(sniperdff, 73)
+-- Standard (Female)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/standard_female.txd")
+engineImportTXD(snipertxd, 192)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/standard_female.dff", 192)
+engineReplaceModel(sniperdff, 192)
+-- Civilian (Male)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/civilian_male.txd")
+engineImportTXD(snipertxd, 179)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/civilian_male.dff", 179)
+engineReplaceModel(sniperdff, 179)
+--Civilian (Female)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/civilian_female.txd")
+engineImportTXD(snipertxd, 172)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/civilian_female.dff", 172)
+engineReplaceModel(sniperdff, 172)
+-- Ghillie Suit
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/ghilliesuit.txd")
+engineImportTXD(snipertxd, 285)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/ghilliesuit.dff", 285)
+engineReplaceModel(sniperdff, 285)
+--Bandit 1 (Male)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit1_male.txd")
+engineImportTXD(snipertxd, 180)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit1_male.dff", 180)
+engineReplaceModel(sniperdff, 180)
+-- Bandit 1 (Female)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit1_female.txd")
+engineImportTXD(snipertxd, 191)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit1_female.dff", 191)
+engineReplaceModel(sniperdff, 191)
+--Bandit 2 (Male)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit2_male.txd")
+engineImportTXD(snipertxd, 288)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit2_male.dff", 288)
+engineReplaceModel(sniperdff, 288)
+-- Bandit 2 (Female)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/bandit2_female.txd")
+engineImportTXD(snipertxd, 211)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/bandit2_female.dff", 211)
+engineReplaceModel(sniperdff, 211)
+-- Hero (Male)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/hero_male.txd")
+engineImportTXD(snipertxd, 210)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/hero_male.dff", 210)
+engineReplaceModel(sniperdff, 210)
+-- Army (Male)
+snipertxd = engineLoadTXD(":DayZ/models/players/txd/army_male.txd")
+engineImportTXD(snipertxd, 287)
+sniperdff = engineLoadDFF(":DayZ/models/players/dff/army_male.dff", 287)
+engineReplaceModel(sniperdff, 287)
+
-- // Items // --
itemTXD = engineLoadTXD(":DayZ/models/items/txd/clothing.txd")
engineImportTXD(itemTXD, 1247)
diff --git a/DayZ/sounds/sounds.lua b/DayZ/sounds/sounds.lua
index 6aad6dc..57d070c 100644
--- a/DayZ/sounds/sounds.lua
+++ b/DayZ/sounds/sounds.lua
@@ -179,8 +179,9 @@ local weaponSounds = {
["Mosin-Nagant"] = {120,":DayZ/sounds/weapons/fire/Mosin.wav"},
["Enfield"] = {120,":DayZ/sounds/weapons/fire/Enfield.wav"},
["CZ 550"] = {240,":DayZ/sounds/weapons/fire/CZ550.wav"},
- ["DMR"] = {5,":DayZ/sounds/weapons/fire/DMR.wav"},
- ["SVD Dragunov"] = {240,":DayZ/sounds/weapons/fire/Dragunov.wav"}
+ ["DMR"] = {gameplayVariables["silencedDMRs"] and 5 or 240,":DayZ/sounds/weapons/fire/DMR.wav"},
+ ["SVD Dragunov"] = {240,":DayZ/sounds/weapons/fire/Dragunov.wav"},
+ ["M24"] = {240,":DayZ/sounds/weapons/fire/M24.wav"},
}
function playSoundOnWeaponFire(weapon)
diff --git a/DayZ/sounds/weapons/fire/M24.wav b/DayZ/sounds/weapons/fire/M24.wav
new file mode 100644
index 0000000..bc238b5
Binary files /dev/null and b/DayZ/sounds/weapons/fire/M24.wav differ
diff --git a/DayZ/tables/table_achievements.lua b/DayZ/tables/table_achievements.lua
index 0012210..2708eec 100644
--- a/DayZ/tables/table_achievements.lua
+++ b/DayZ/tables/table_achievements.lua
@@ -108,4 +108,25 @@ achievements = {
["conditions"] = {{"blood","less",6000}},
["image"] = "achiev1.png"
},
+ ["goingcommando"] = {
+ ["name"] = "Going Commando",
+ ["description"] = "Wear no clothes",
+ ["items"] = {{"MRE",0},{"Can (Corn)",0}},
+ ["conditions"] = {{"blank","clothes",0}},
+ ["image"] = "achiev1.png"
+ },
+ ["area69"] = {
+ ["name"] = "Roswell Conspiracies",
+ ["description"] = "Visit Area 69",
+ ["items"] = {{"MRE",0},{"Can (Corn)",0}},
+ ["conditions"] = {{"blank","area",0}},
+ ["image"] = "achiev1.png"
+ },
+ ["sanfierrocarrier"] = {
+ ["name"] = "USS Werfukd",
+ ["description"] = "Visit the San Fierro Carrier",
+ ["items"] = {{"MRE",0},{"Can (Corn)",0}},
+ ["conditions"] = {{"blank","carrier",0}},
+ ["image"] = "achiev1.png"
+ },
}
diff --git a/DayZ/tables/table_general.lua b/DayZ/tables/table_general.lua
index f79bea1..ef557a5 100644
--- a/DayZ/tables/table_general.lua
+++ b/DayZ/tables/table_general.lua
@@ -152,7 +152,7 @@ hospitalPacks = {
{2042.7001953125,-1409.4775390625,17.1640625},
{-316.5478515625,1051.6494140625,20.340259552002},
{-337.9541015625,1049.490234375,19.739168167114},
-{-331.5849609375,1046.037109375,26.012474060059},
+{-323.2678330078,1052.5776367188,20.340259552002},
{-307.0419921875,1045.27734375,26.012474060059},
{1171.490234375,-1310.560546875,13.986573219299},
{1171.609375,-1306.556640625,13.996350288391},
diff --git a/DayZ/tables/table_loot.lua b/DayZ/tables/table_loot.lua
index 1ebb154..5603a97 100644
--- a/DayZ/tables/table_loot.lua
+++ b/DayZ/tables/table_loot.lua
@@ -52,68 +52,33 @@ buildingClasses = {
{"Crossbow",349,1,90,0.28},
{"Binoculars",369,1,0,1.68},
{"Wood Pile",1463,2,0,1.68},
-{"Africa collar",2654,0.1,0,0.8},
-{"Silver collar",2654,0.1,0,0.8},
-{"Gold collar",2654,0.1,0,0.8},
-{"LS collar",2654,0.1,0,0.8},
-{"Black Bandana (M)",2654,0.1,0,0.8},
-{"Blue Bandana (M)",2654,0.1,0,0.8},
-{"Green Bandana (M)",2654,0.1,0,0.8},
-{"Red Bandana (M)",2654,0.1,0,0.8},
-{"Black Bandana (H)",2654,0.1,0,0.8},
-{"Blue Bandana (H)",2654,0.1,0,0.8},
-{"Green Bandana (H)",2654,0.1,0,0.8},
-{"Red Bandana (H)",2654,0.1,0,0.8},
-{"Black Beret",2654,0.1,0,0.8},
-{"Red Beret",2654,0.1,0,0.8},
-{"Old Hat",2654,0.1,0,0.8},
-{"Black Hat",2654,0.1,0,0.8},
-{"Yellow Hat",2654,0.1,0,0.8},
-{"Black Trucker",2654,0.1,0,0.8},
-{"Blue Trucker",2654,0.1,0,0.8},
-{"Green Trucker",2654,0.1,0,0.8},
-{"Red Trucker",2654,0.1,0,0.8},
-{"Yellow Trucker",2654,0.1,0,0.8},
-{"Cow-Boy Hat",2654,0.1,0,0.8},
-{"White Hat",2654,0.1,0,0.8},
-{"Hockey Mask",2654,0.1,0,0.8},
-{"Black Shoe",2654,0.1,0,0.8},
-{"Sport Shoe",2654,0.1,0,0.8},
-{"Brown Shoe",2654,0.1,0,0.8},
-{"Biker Shoe",2654,0.1,0,0.8},
-{"Blue Shoe",2654,0.1,0,0.8},
-{"Red Shoe",2654,0.1,0,0.8},
-{"Beach Shoe",2654,0.1,0,0.8},
-{"Black Pants",2654,0.1,0,0.8},
-{"Beige Pants",2654,0.1,0,0.8},
-{"Gray Shorts",2654,0.1,0,0.8},
-{"Blue Shorts",2654,0.1,0,0.8},
-{"Blue Jeans",2654,0.1,0,0.8},
-{"Green Jeans",2654,0.1,0,0.8},
-{"Gray Pants",2654,0.1,0,0.8},
-{"Yellow Pants",2654,0.1,0,0.8},
-{"Blue Jogging",2654,0.1,0,0.8},
-{"Gray Jogging",2654,0.1,0,0.8},
-{"Military Pants",2654,0.1,0,0.8},
-{"Beige Vest",2654,0.1,0,0.8},
-{"Baseball Shirt",2654,0.1,0,0.8},
-{"Baseball 2 Shirt",2654,0.1,0,0.8},
-{"Red Vest",2654,0.1,0,0.8},
-{"Grey Shirt",2654,0.1,0,0.8},
-{"Green Vest",2654,0.1,0,0.8},
-{"Hawai Shirt",2654,0.1,0,0.8},
-{"Black Vest",2654,0.1,0,0.8},
-{"Brown Vest",2654,0.1,0,0.8},
-{"Biker Vest",2654,0.1,0,0.8},
-{"Blue Shirt",2654,0.1,0,0.8},
-{"Green 2 Vest",2654,0.1,0,0.8},
-{"Number 5 Shirt",2654,0.1,0,0.8},
-{"Monk Shirt",2654,0.1,0,0.8},
-{"Dark Glasses",2654,0.1,0,0.8},
-{"Square Glasses",2654,0.1,0,0.8},
-{"Red Glasses",2654,0.1,0,0.8},
{"Crowbar",333,1,90,2.24},
{"Double-barreled Shotgun",349,1,90,0.84},
+{"Camouflage Clothing",1247,2,0,0.28},
+{"Ghillie Suit",1213,2,0,0.28},
+{"Yellow Hat",1247,1,90,0.8},
+{"Baseball Shirt",1247,1,90,0.11},
+{"Baseball 2 Shirt",1247,1,90,0.11},
+{"Gray Jogging",1247,1,90,1.00},
+{"Beige Vest",1247,1,90,0.87},
+{"Red Vest",1247,1,90,0.65},
+{"Grey Shirt",1247,1,90,0.49},
+{"Green Vest",1247,1,90,0.13},
+{"Africa collar",1247,1,90,0.13},
+{"Blue Bandana (M)",1247,1,90,0.13},
+{"Green Bandana (M)",1247,1,90,0.13},
+{"Red Bandana (M)",1247,1,90,0.13},
+{"Blue Bandana (H)",1247,1,90,0.13},
+{"Green Bandana (H)",1247,1,90,0.13},
+{"Red Bandana (H)",1247,1,90,0.13},
+{"Red Beret",1247,1,90,0.13},
+{"Old Hat",1247,1,90,0.13},
+{"Cow-Boy Hat",1247,1,90,0.13},
+{"Sport Shoe",1247,1,90,0.13},
+{"Red Shoe",1247,1,90,0.13},
+{"Beach Shoe",1247,1,90,0.13},
+{"Yellow Pants",1247,1,90,0.13},
+{"Blue Jogging",1247,1,90,0.13},
},
-- Not yet implemented
@@ -140,6 +105,8 @@ buildingClasses = {
{"Binoculars",369,1,0,1.68},
{"Wood Pile",1463,2,0,1.68},
{"Crowbar",333,1,90,2.24},
+{"Camouflage Clothing",1247,2,0,0.28},
+{"Ghillie Suit",1247,2,0,0.28},
},
["Industrial"] = {
@@ -158,6 +125,11 @@ buildingClasses = {
{"Hunting Knife",335,1,90,6.86},
{"Toolbox",2969,1.5,0,1.96},
{"Wire Fence",933,0.25,0,0.98},
+{"Number 5 Shirt",1247,1,90,0.05},
+{"Monk Shirt",1247,1,90,0.42},
+{"Red Glasses",1247,1,90,0.17},
+{"Silver collar",1247,1,90,0.11},
+{"LS collar",1247,1,90,0.74},
},
["Farm"] = {
@@ -171,6 +143,18 @@ buildingClasses = {
{"Wood Pile",1463,0.4,0,10.78},
{"Hatchet",339,1,90,16.67},
{"Double-barreled Shotgun",349,1,90,5.88},
+{"Black Trucker",1247,1,90,0.23},
+{"Blue Trucker",1247,1,90,0.23},
+{"Green Trucker",1247,1,90,0.23},
+{"Red Trucker",1247,1,90,0.23},
+{"Yellow Trucker",1247,1,90,0.23},
+{"Brown Shoe",1247,1,90,1.23},
+{"Biker Shoe",1247,1,90,2.94},
+{"Blue Shoe",1247,1,90,0.31},
+{"Blue Shorts",1247,1,90,0.13},
+{"Blue Jeans",1247,1,90,0.31},
+{"Green Jeans",1247,1,90,0.65},
+{"Gray Pants",1247,1,90,0.90},
},
["Supermarket"] = {
@@ -195,6 +179,16 @@ buildingClasses = {
{"Binoculars",369,1,0,4.72},
{"Wood Pile",1463,2,0,1.89},
{"Double-barreled Shotgun",349,1,90,0.94},
+{"Black Hat",1247,1,90,0.43},
+{"Gold collar",1247,1,90,0.11},
+{"Hawai Shirt",1247,1,90,0.43},
+{"Brown Vest",1247,1,90,0.87},
+{"Biker Vest",1247,1,90,0.10},
+{"Blue Shirt",1247,1,90,0.28},
+{"Green 2 Vest",1247,1,90,1.20},
+{"Black Pants",1247,1,90,1.65},
+{"Beige Pants",1247,1,90,0.69},
+{"Gray Shorts",1247,1,90,0.34},
},
["Military"] = {
@@ -226,6 +220,18 @@ buildingClasses = {
{"British Assault Pack",1644,1,0,1.76},
{"Backpack (Coyote)",1252,1,0,1.38},
{"Range Finder",369,1,0,0.11},
+{"Black Vest",1247,1,90,0.96},
+{"Dark Glasses",1247,1,90,0.96},
+{"Square Glasses",1247,1,90,0.96},
+{"Military Pants",1247,1,90,1.03},
+{"Black Bandana (H)",1247,1,90,0.28},
+{"Helmet",1247,1,90,0.28},
+{"MX Helmet",1247,1,90,0.28},
+{"Black Beret",1247,1,90,1.03},
+{"Black Bandana (M)",1247,1,90,0.54},
+{"White Hat",1247,1,90,0.08},
+{"Hockey Mask",1247,1,90,0.01},
+{"Black Shoe",1247,1,90,1.98},
-- medical: 1.91% ~ 2%
-- generic: 19.12% ~ 19%
-- military: 47.8% ~ 48%
@@ -292,70 +298,12 @@ buildingClasses = {
{"Binoculars",369,1,0,1.15},
{"Wood Pile",1463,2,0,5},
{"Crowbar",333,1,90,2.24},
+{"Camouflage Clothing",1247,2,0,4.5},
+{"Ghillie Suit",1247,2,0,0.01},
},
["other"] = {
{"M1911",346,1,90},
-{"Africa collar",2654,1,90},
-{"Silver collar",2654,1,90},
-{"Gold collar",2654,1,90},
-{"LS collar",2654,1,90},
-{"Black Bandana (M)",2654,1,90},
-{"Blue Bandana (M)",2654,1,90},
-{"Green Bandana (M)",2654,1,90},
-{"Red Bandana (M)",2654,1,90},
-{"Black Bandana (H)",2654,1,90},
-{"Blue Bandana (H)",2654,1,90},
-{"Green Bandana (H)",2654,1,90},
-{"Red Bandana (H)",2654,1,90},
-{"Black Beret",2654,1,90},
-{"Red Beret",2654,1,90},
-{"Old Hat",2654,1,90},
-{"Black Hat",2654,1,90},
-{"Yellow Hat",2654,1,90},
-{"Black Trucker",2654,1,90},
-{"Blue Trucker",2654,1,90},
-{"Green Trucker",2654,1,90},
-{"Red Trucker",2654,1,90},
-{"Yellow Trucker",2654,1,90},
-{"Cow-Boy Hat",2654,1,90},
-{"White Hat",2654,1,90},
-{"Hockey Mask",2654,1,90},
-{"Black Shoe",2654,1,90},
-{"Sport Shoe",2654,1,90},
-{"Brown Shoe",2654,1,90},
-{"Biker Shoe",2654,1,90},
-{"Blue Shoe",2654,1,90},
-{"Red Shoe",2654,1,90},
-{"Beach Shoe",2654,1,90},
-{"Black Pants",2654,1,90},
-{"Beige Pants",2654,1,90},
-{"Gray Shorts",2654,1,90},
-{"Blue Shorts",2654,1,90},
-{"Blue Jeans",2654,1,90},
-{"Green Jeans",2654,1,90},
-{"Gray Pants",2654,1,90},
-{"Yellow Pants",2654,1,90},
-{"Blue Jogging",2654,1,90},
-{"Gray Jogging",2654,1,90},
-{"Military Pants",2654,1,90},
-{"Beige Vest",2654,1,90},
-{"Baseball Shirt",2654,1,90},
-{"Baseball 2 Shirt",2654,1,90},
-{"Red Vest",2654,1,90},
-{"Grey Shirt",2654,1,90},
-{"Green Vest",2654,1,90},
-{"Hawai Shirt",2654,1,90},
-{"Black Vest",2654,1,90},
-{"Brown Vest",2654,1,90},
-{"Biker Vest",2654,1,90},
-{"Blue Shirt",2654,1,90},
-{"Green 2 Vest",2654,1,90},
-{"Number 5 Shirt",2654,1,90},
-{"Monk Shirt",2654,1,90},
-{"Dark Glasses",2654,1,90},
-{"Square Glasses",2654,1,90},
-{"Red Glasses",2654,1,90},
{"Revolver",348,1,90},
{"Makarov PM",346,1,90},
{"Bizon PP-19 SD",353,1,90},
@@ -566,7 +514,6 @@ buildingClasses = {
{"Empty Soda Can",2673,0.5,0},
{"Empty Tin Can",2673,0.5,0},
{"Broken Whiskey Bottle",2673,0.5,0},
-
{"DIY (Wood)",2969,0.5,0},
{"DIY (Metal)",2969,0.5,0},
{"Log",2969,0.5,0},
@@ -575,6 +522,70 @@ buildingClasses = {
{"RSJ",2969,0.5,0},
{"Metal Sheet",2969,0.5,0},
{"Metal Sheet (Rusted)",2969,0.5,0},
+{"Survivor Clothing",1247,2,0},
+{"Civilian Clothing",1247,2,0},
+{"Camouflage Clothing",1247,2,0},
+{"Ghillie Suit",1247,2,0},
+{"Africa collar",1247,1,90},
+{"Silver collar",1247,1,90},
+{"Gold collar",1247,1,90},
+{"LS collar",1247,1,90},
+{"Black Bandana (M)",1247,1,90},
+{"Blue Bandana (M)",1247,1,90},
+{"Green Bandana (M)",1247,1,90},
+{"Red Bandana (M)",1247,1,90},
+{"Black Bandana (H)",1247,1,90},
+{"Blue Bandana (H)",1247,1,90},
+{"Green Bandana (H)",1247,1,90},
+{"Red Bandana (H)",1247,1,90},
+{"Black Beret",1247,1,90},
+{"Red Beret",1247,1,90},
+{"Old Hat",1247,1,90},
+{"Black Hat",1247,1,90},
+{"Yellow Hat",1247,1,90},
+{"Black Trucker",1247,1,90},
+{"Blue Trucker",1247,1,90},
+{"Green Trucker",1247,1,90},
+{"Red Trucker",1247,1,90},
+{"Yellow Trucker",1247,1,90},
+{"Cow-Boy Hat",1247,1,90},
+{"White Hat",1247,1,90},
+{"Hockey Mask",1247,1,90},
+{"Black Shoe",1247,1,90},
+{"Sport Shoe",1247,1,90},
+{"Brown Shoe",1247,1,90},
+{"Biker Shoe",1247,1,90},
+{"Blue Shoe",1247,1,90},
+{"Red Shoe",1247,1,90},
+{"Beach Shoe",1247,1,90},
+{"Black Pants",1247,1,90},
+{"Beige Pants",1247,1,90},
+{"Gray Shorts",1247,1,90},
+{"Blue Shorts",1247,1,90},
+{"Blue Jeans",1247,1,90},
+{"Green Jeans",1247,1,90},
+{"Gray Pants",1247,1,90},
+{"Yellow Pants",1247,1,90},
+{"Blue Jogging",1247,1,90},
+{"Gray Jogging",1247,1,90},
+{"Military Pants",1247,1,90},
+{"Beige Vest",1247,1,90},
+{"Baseball Shirt",1247,1,90},
+{"Baseball 2 Shirt",1247,1,90},
+{"Red Vest",1247,1,90},
+{"Grey Shirt",1247,1,90},
+{"Green Vest",1247,1,90},
+{"Hawai Shirt",1247,1,90},
+{"Black Vest",1247,1,90},
+{"Brown Vest",1247,1,90},
+{"Biker Vest",1247,1,90},
+{"Blue Shirt",1247,1,90},
+{"Green 2 Vest",1247,1,90},
+{"Number 5 Shirt",1247,1,90},
+{"Monk Shirt",1247,1,90},
+{"Dark Glasses",1247,1,90},
+{"Square Glasses",1247,1,90},
+{"Red Glasses",1247,1,90},
},
}
@@ -878,5 +889,8 @@ lootpileType = {
{"Golf Club",333,1,90,1.9},
{"Baseball Bat",336,1,90,1.4},
{"Shovel",337,1,90,1.5},
+{"Survivor Clothing",1247,2,0},
+{"Civilian Clothing",1247,2,0,3.5},
+{"Camouflage Clothing",1247,2,0,4.5},
},
}
\ No newline at end of file
diff --git a/DayZ/tables/table_player.lua b/DayZ/tables/table_player.lua
index eac3d54..a6ec67e 100644
--- a/DayZ/tables/table_player.lua
+++ b/DayZ/tables/table_player.lua
@@ -8,83 +8,78 @@
#-----------------------------------------------------------------------------#
]]
spawnPositions = {
+{-2185.6669921875,2957.380859375,11.474840164185},
+{-1056.8720703125,2939.068359375,42.311294555664},
+{-1952.9411621094,2200.000000000,5.3285703659058},
+{-233.46484375,-1735.8173828125,1.5520644187927},
+{1056.5900878906,-2356.1455078125,12.924290657043},
+{2896.6047363281,-2139.8461914063,3.377733707428},
+{-2911.51171875,-895.22265625,2.4013109207153},
+{-2947.7758789063,1095.8127441406,6.4143829345703},
+{-2369.7875976563,-884.27557373047,19.71940612793},
+{2803.943359375,595.9365234375,7.7612648010254},
+{1142.1452636719,672.907958983438,10.606409072876},
+{2432.7734375,2970.3952636719,28.820823669434},
+{-1816.9375,-2748.18359375,1.7327127456665},
+{-2816.166015625,-2439.0546875,2.4004096984863},
+{-2941.5673828125,-1206.2373046875,2.7848854064941},
{-278.6669921875,-2882.1572265625,32.104232788086},
{-958.5595703125,-2887.9912109375,64.82421875},
+{272.2265625,2928.505859375,1.3713493347168},
+{157.36102294922,648.98712158203,3.1540131568909},
+{2883.7509765625,-178.4658203125,3.2714653015137},
+{98.209899902344,141.20268249512,2.4296875},
+}
+
+spawnPositionsSelection = {
+["Tierra Robada"] = {
+{-2185.6669921875,2957.380859375,11.474840164185},
+{-1056.8720703125,2939.068359375,42.311294555664},
+{-1952.9411621094,2200.000000000,5.3285703659058},
+},
+
+["Los Santos"] = {
+{-233.46484375,-1735.8173828125,1.5520644187927},
+{1056.5900878906,-2356.1455078125,12.924290657043},
+{2896.6047363281,-2139.8461914063,3.377733707428},
+},
+
+["San Fierro"] = {
+{-2911.51171875,-895.22265625,2.4013109207153},
+{-2947.7758789063,1095.8127441406,6.4143829345703},
+{-2369.7875976563,-884.27557373047,19.71940612793},
+},
+
+["Las Venturas"] = {
+{2803.943359375,595.9365234375,7.7612648010254},
+{1142.1452636719,672.907958983438,10.606409072876},
+{2432.7734375,2970.3952636719,28.820823669434},
+},
+
+["Whetstone"] = {
{-1816.9375,-2748.18359375,1.7327127456665},
{-2816.166015625,-2439.0546875,2.4004096984863},
{-2941.5673828125,-1206.2373046875,2.7848854064941},
-{-2911.51171875,-895.22265625,2.4013109207153},
-{-2185.6669921875,2957.380859375,11.474840164185},
+},
+
+["Flint County"] = {
+{-278.6669921875,-2882.1572265625,32.104232788086},
+{-958.5595703125,-2887.9912109375,64.82421875},
+},
+
+["Bone County"] = {
{272.2265625,2928.505859375,1.3713493347168},
-{2803.943359375,595.9365234375,7.7612648010254},
+{157.36102294922,648.98712158203,3.1540131568909},
+},
+
+["Red County"] = {
{2883.7509765625,-178.4658203125,3.2714653015137},
-{-233.46484375,-1735.8173828125,1.5520644187927},
-{-1056.8720703125,2939.068359375,42.311294555664},
-}
---[[
-playerDefaultValues = {
-{"Bandage",2},
-{"Painkiller",1},
-{"Flashlight",1},
-{"Beige Pants",1},
-{"Beige Vest",1},
-{"Black Shoe",1},
-{"MAX_Slots",8},
-{"Item_Slots",1},
-{"Backpack_Slots",8},
-{"Backpack_Item_Slots",8},
-{"Back_Weapon_Slots",1},
-{"skin",0},
-{"blood",12000},
-{"temperature",37},
-{"brokenbone",false},
-{"pain",false},
-{"cold",false},
-{"infection",false},
-{"unconscious",false},
-{"food",100},
-{"thirst",100},
-{"currentweapon_1",false},
-{"currentweapon_2",false},
-{"currentweapon_3",false},
-{"bandit",false},
-{"humanity", 2500},
-{"bloodtype",{}}, --Handled inside the for loop
-{"bloodtypeisdiscovered","?"},
-}
+{98.209899902344,141.20268249512,2.4296875},
+},
-playerDefaultValues = {
- ["Bandage"] = 2,
- ["Painkiller"] = 1,
- ["Flashlight"] = 1,
- ["Beige Pants"] = 1,
- ["Beige Vest"] = 1,
- ["Black Shoe"] = 1,
- ["MAX_Slots"] = 8,
- ["Item_Slots"] = 1,
- ["Backpack_Slots"] = 8,
- ["Backpack_Item_Slots"] = 8,
- ["Back_Weapon_Slots"] = 0,
- ["skin"] = 0,
- ["blood"] = 12000,
- ["temperature"] = 37,
- ["brokenbone"] = false,
- ["pain"] = false,
- ["cold"] = false,
- ["infection"] = false,
- ["unconscious"] = false,
- ["food"] = 100,
- ["thirst"] = 100,
- ["currentweapon_1"] = false,
- ["currentweapon_2"] = false,
- ["currentweapon_3"] = false,
- ["bandit"] = false,
- ["humanity"] = 2500,
- ["bloodtype"] = {}, --Handled inside the for loop
- ["bloodtypeisdiscovered"] = "?"
}
-]]
+playerDynamicTable = {}
-- FORMAT: {"item",DefaultValue}
playerDataTable = {
@@ -239,6 +234,12 @@ playerDataTable = {
{"Cooked Meat",0},
{"Radio Device",0},
{"Compass",0},
+{"Camouflage Clothing",0},
+{"Civilian Clothing",0},
+{"Survivor Clothing",0},
+{"Survivor Clothing (Female)",0},
+{"Civilian Clothing (Female)",0},
+{"Ghillie Suit",0},
{"Military collar",0},
{"Africa collar",0},
{"Gold collar",0},
@@ -265,7 +266,7 @@ playerDataTable = {
{"Cow-Boy Hat",0},
{"White Hat",0},
{"Hockey Mask",0},
-{"Black Shoe",1},
+{"Black Shoe",0},
{"Sport Shoe",0},
{"Brown Shoe",0},
{"Biker Shoe",0},
@@ -273,7 +274,7 @@ playerDataTable = {
{"Red Shoe",0},
{"Beach Shoe",0},
{"Black Pants",0},
-{"Beige Pants",1},
+{"Beige Pants",0},
{"Gray Shorts",0},
{"Blue Shorts",0},
{"Blue Jeans",0},
@@ -283,7 +284,7 @@ playerDataTable = {
{"Blue Jogging",0},
{"Gray Jogging",0},
{"Military Pants",0},
-{"Beige Vest",1},
+{"Beige Vest",0},
{"Baseball Shirt",0},
{"Baseball 2 Shirt",0},
{"Red Vest",0},
@@ -300,6 +301,8 @@ playerDataTable = {
{"Dark Glasses",0},
{"Square Glasses",0},
{"Red Glasses",0},
+{"Helmet",0},
+{"MX Helmet",0},
{"Empty Water Bottle",0},
{"Empty Soda Can",0},
{"Empty Tin Can",0},
@@ -404,7 +407,6 @@ playerDataTable = {
{"Metal Plate",0},
{"Metallic Stick",0},
{"Small Casing",0},
-
{"DIY (Wood)",0},
{"DIY (Metal)",0},
{"Log",0},
@@ -415,6 +417,97 @@ playerDataTable = {
{"Metal Sheet (Rusted)",0},
}
+skinTable = {
+{"Camouflage Clothing",287},
+{"Civilian Clothing",179},
+{"Ghillie Suit",285},
+{"Survivor Clothing",73},
+{"Survivor Clothing (Female)",192},
+{"Civilian Clothing (Female)",172},
+ }
+
+clothesTable = {
+["Collar"] = {
+{"Military collar"},
+{"Africa collar"},
+{"Gold collar"},
+{"Silver collar"},
+{"LS collar"},
+},
+
+["Head"] = {
+{"Black Bandana (M)"},
+{"Blue Bandana (M)"},
+{"Green Bandana (M)"},
+{"Red Bandana (M)"},
+{"Black Bandana (H)"},
+{"Blue Bandana (H)"},
+{"Green Bandana (H)"},
+{"Red Bandana (H)"},
+{"Black Beret"},
+{"Red Beret"},
+{"Old Hat"},
+{"Black Hat"},
+{"Yellow Hat"},
+{"Black Trucker"},
+{"Blue Trucker"},
+{"Green Trucker"},
+{"Red Trucker"},
+{"Yellow Trucker"},
+{"Cow-Boy Hat"},
+{"White Hat"},
+{"Hockey Mask"},
+},
+
+["Feet"] = {
+{"Black Shoe"},
+{"Sport Shoe"},
+{"Brown Shoe"},
+{"Biker Shoe"},
+{"Blue Shoe"},
+{"Red Shoe"},
+{"Beach Shoe"},
+},
+
+["Legs"] = {
+{"Black Pants"},
+{"Beige Pants"},
+{"Gray Shorts"},
+{"Blue Shorts"},
+{"Blue Jeans"},
+{"Green Jeans"},
+{"Gray Pants"},
+{"Yellow Pants"},
+{"Blue Jogging"},
+{"Gray Jogging"},
+{"Military Pants"},
+},
+
+["Torso"] = {
+{"Beige Vest"},
+{"Baseball Shirt"},
+{"Baseball 2 Shirt"},
+{"Red Vest"},
+{"Grey Shirt"},
+{"Green Vest"},
+{"Hawai Shirt"},
+{"Black Vest"},
+{"Brown Vest"},
+{"Biker Vest"},
+{"Blue Shirt"},
+{"Green 2 Vest"},
+{"Number 5 Shirt"},
+{"Monk Shirt"},
+},
+
+["Eyes"] = {
+{"Dark Glasses"},
+{"Square Glasses"},
+{"Red Glasses"},
+},
+}
+
+
weaponNoiseTable = {
-- {ID, Base Noise, Divisor}
{2,20,5},
@@ -450,9 +543,6 @@ weaponNoiseTable = {
{36,100,0.4},
}
-skinTable = {
-}
-
craftingTable = {
-- {string Blueprint Name, string Blueprint Result, int Result Number, string Part1, string Part2, string Part3, int Part1Required, int Part2Required, int Part3Required, int CraftingTime},
--[[
diff --git a/DayZ/tables/table_tents.lua b/DayZ/tables/table_tents.lua
index d3b8171..5f1183a 100644
--- a/DayZ/tables/table_tents.lua
+++ b/DayZ/tables/table_tents.lua
@@ -125,6 +125,12 @@ tentTable = {
{"Cooked Meat"},
{"Radio Device"},
{"Compass"},
+{"Camouflage Clothing"},
+{"Civilian Clothing"},
+{"Survivor Clothing"},
+{"Survivor Clothing (Female)"},
+{"Civilian Clothing (Female)"},
+{"Ghillie Suit"},
{"Military collar"},
{"Africa collar"},
{"Gold collar"},
@@ -186,6 +192,8 @@ tentTable = {
{"Dark Glasses"},
{"Square Glasses"},
{"Red Glasses"},
+{"Helmet"},
+{"MX Helmet"},
{"Empty Water Bottle"},
{"Empty Soda Can"},
{"Empty Tin Can"},
diff --git a/DayZ/tables/table_vehicles.lua b/DayZ/tables/table_vehicles.lua
index 74c2954..12a921d 100644
--- a/DayZ/tables/table_vehicles.lua
+++ b/DayZ/tables/table_vehicles.lua
@@ -125,6 +125,12 @@ vehicleDataTable = {
{"Cooked Meat"},
{"Radio Device"},
{"Compass"},
+{"Camouflage Clothing"},
+{"Civilian Clothing"},
+{"Survivor Clothing"},
+{"Survivor Clothing (Female)"},
+{"Civilian Clothing (Female)"},
+{"Ghillie Suit"},
{"Military collar"},
{"Africa collar"},
{"Gold collar"},
@@ -186,6 +192,8 @@ vehicleDataTable = {
{"Dark Glasses"},
{"Square Glasses"},
{"Red Glasses"},
+{"Helmet"},
+{"MX Helmet"},
{"Empty Water Bottle"},
{"Empty Soda Can"},
{"Empty Tin Can"},
diff --git a/DayZ/tools/exports.lua b/DayZ/tools/exports.lua
index ee19413..c62b766 100644
--- a/DayZ/tools/exports.lua
+++ b/DayZ/tools/exports.lua
@@ -14,19 +14,29 @@ getPlayerBlood - Arguments: element player. Returns: Amount of blood the player
setPlayerBlood - Arguments: element player, int amount. Effect: sets player's blood to specified amount
getPlayerZombiesKilled - Arguments: element player. Returns: Amount of zombies player has killed (int)
setPlayerZombiesKilled - Arguments: element player, int amount. Effect: sets amount of killed zombies for player to specified value
+
getPlayerHeadshots - Arguments: element player. Returns: Amount of head shots player has delivered (int)
setPlayerHeadshots - Arguments: element player, int amount. Effect: sets amount of head shots player has delivered to specified value
getPlayerMurders - Arguments: element player. Returns: Amount of murders player has committed (int)
setPlayerMurders - Arguments: element player, int amount. Effect: sets amount of murders to specified value
+
getPlayerBanditsKilled - Arguments: element player. Returns: Amount of bandits player has killed
setPlayerBanditsKilled - Arguments: element player, int amount. Effect: sets amount of killed bandits to specified value
getPlayerTemperature - Arguments: element player. Returns: Temperature of player (int)
setPlayerTemperature - Arguments: element player, int amount. Effect: sets temperature to specified value
+
getPlayerHumanity - Arguments: element player. Returns: Humanity of player (int)
setPlayerHumanity - Arguments: element player, int amount. Effect: sets humanity to specified value
getActualTime - No Arguments. Returns Actual Real Time, Format: HH:MM:SS
getDayZVersion - No Arguments. Returns running DayZ version
+setGameplayVariablesClient - Arguments: variable name, variable value. Effect: Create or set a GameplayVariable [CLIENT Only]
+setGameplayVariablesServer - Arguments: variable name, variable value. Effect: Create or set a GameplayVariable [SERVER Only]
+
+getGameplayVariablesClient - Arguments: variable name. Returns: Value of the variable [CLIENT Only]
+getGameplayVariablesServer - Arguments: variable name. Returns: Value of the variable [SERVER Only]
+setGameplayVariable - Arguments: variable name, variable value. Effect: Create or set a GameplayVariable [SHARED]
+getGameplayVariable - Arguments: variable name. Returns: Value of the variable [SHARED]
]]
-- [[ VERSION HANDLER ]]
@@ -157,4 +167,43 @@ function getActualTime()
seconds = theTime.second
end
return hour, minute, seconds
-end
\ No newline at end of file
+end
+
+function getGameplayVariablesServer()
+local variablesTable = {}
+ for key, var in pairs(gameplayVariables) do
+ table.insert(variablesTable,{key,var})
+ end
+ return variablesTable
+end
+
+function getGameplayVariablesServerPairs() -- Proposed format
+local variablesTable = {}
+ for key, var in pairs(gameplayVariables) do
+ -- OLD: table.insert(variablesTable,{key,var})
+ variablesTable[key] = var -- UPDATE: Made it easy to get variable: getGameplayVariablesServer()["var"] instead of a loop to get info
+ end
+ return variablesTable
+end
+
+function getGameplayVariablesClient()
+local variablesTable = {}
+ for key, var in pairs(gameplayVariables) do
+ table.insert(variablesTable,{key,var})
+ end
+ return variablesTable
+end
+
+
+function setGameplayVariable(var,value)
+ if gameplayVariables[var] ~= nil then
+ gameplayVariables[var] = value
+ end
+end
+
+function getGameplayVariable(var)
+ return gameplayVariables[var]
+end
+
+
+
diff --git a/DayZ/utilities.lua b/DayZ/utilities.lua
index 0187a70..5654934 100644
--- a/DayZ/utilities.lua
+++ b/DayZ/utilities.lua
@@ -50,7 +50,7 @@ function isObjectAroundPlayer2 ( thePlayer, distance, height )
for i = math.random(0,360), 360, 1 do
local nx, ny = getPointFromDistanceRotation( x, y, distance, i )
local hit, hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ, material = processLineOfSight ( x, y, z + height, nx, ny, z + height,true,false,false,false,false,false,false,false )
- if material == 0 then
+ if material == 0 or material == 1 or material == 2 or material == 3 then
material_value = material_value+1
end
if material_value > 40 then
diff --git a/README.md b/README.md
index d0acb44..e622aca 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# README #
-### Curent Developers: L, ciber96, 1BOY ###
+### Curent Developers: L, ciber96, 1B0Y ###
### Synopsis ###
This repository serves as a "hub" for the development of MTA DayZ, a gamemode which is akin to the DayZ mod for ArmA II, only for MTA (Multi Theft Auto).
@@ -15,7 +15,7 @@ changes appropriate, the pull request will be accepted, and you will be marked a
Remeber to keep your fork in sync, more info: http://www.youtube.com/watch?v=-zvHQXnBO6c
### MTA:DayZ Server List ###
-- Currently None -
+https://master.mta-dayz.org/
### Links ###
Website: https://mta-dayz.org/
diff --git a/changelog.txt b/changelog.txt
index d609a29..4cbdf98 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -10,13 +10,25 @@ This changelog lists all changes made to MTA DayZ. It adheres to the following f
### REMOVED: For deprecated features removed in the release it's mentioned in
# - #
-## [0.9.9a] - 2017-MM-DD
+## [0.9.9a] - 2017-04-28
### ADDED: New Sound + Visibility System (based on terrain, weather, light, movement)
+### ADDED: New zombie spawn system based on loot location
### ADDED: Petrol stations now have a limited amount of fuel (configurable in cfgServer.lua)
### ADDED: Achievement System
### ADDED: Anti-Advertising for chat system
### ADDED: Indicators for temperature rising/falling
### ADDED: Occasional rain when weather is cloudy
+### ADDED: MySQL implementation
+### ADDED: Old clothes/skin system
+### ADDED: New condition (fractured arms)
+### ADDED: Vehicle respawn command
+### ADDED: Setting for camera sway when in pain
+### ADDED: Helmets for headshots
+### ADDED: [DayZAdmin] Ability to change gameplayVariables ingame
+### ADDED: Binds for GPS (Key: 7) and Compass (Key: 8)
+### ADDED: Spawn Selection System
+### ADDED: Randomized loot spots
+### ADDED: Random clothes on spawn if clothes system is activated
### CHANGED: Logs System refactored
### CHANGED: Simplified player spawning code
### CHANGED: Simplified vehicle spawning code (makes it easier to add new vehicles)
@@ -27,6 +39,10 @@ This changelog lists all changes made to MTA DayZ. It adheres to the following f
### CHANGED: Version rewrite, tree handling optimised
### CHANGED: Hunger & Thirst now decrease according to difficulty too
### CHANGED: Moved debug monitor to Journal (Key: 6)
+### CHANGED: New damage code for players
+### CHANGED: Some zombies will sprint (depends on difficulty)
+### CHANGED: Kills have to be confirmed with "Check Body" (player kills only)
+### CHANGED: First Person Mode (view can be rotated 360°)
### FIXED: consume_player.lua causing lots of errors
### FIXED: Bug with tree chopping
### FIXED: Hunger & Thirst not decreasing
@@ -37,7 +53,13 @@ This changelog lists all changes made to MTA DayZ. It adheres to the following f
### FIXED: Milk breaking inventory
### FIXED: Unconscious animation being clientside only
### FIXED: M1911 not having a firing sound
+### FIXED: Old bug with damage when falling
+### FIXED: Floating medical box in Fort Carson
+### FIXED: Constant raining
+### FIXED: Hunger and Thirst not really decreasing
+### FIXED: M24 not having any sound
### REMOVED: Viral zombies (until a better solution is found for more dangerous zombies)
+### REMOVED: Housing mod
# - #
## [0.9.8.1a] - 2017-02-18
diff --git a/dayzadmin/dayzadmin_c.lua b/dayzadmin/dayzadmin_c.lua
index 9a802eb..efd43e8 100644
--- a/dayzadmin/dayzadmin_c.lua
+++ b/dayzadmin/dayzadmin_c.lua
@@ -14,6 +14,8 @@ function onAdminPanelOpen()
guiGridListClear(adminpanel.statvgridlist[1])
guiGridListClear(adminpanel.skingridlist[1])
guiGridListClear(adminpanel.vehgridlist[1])
+ guiGridListClear(adminpanel.accessgridlist[1])
+ guiGridListSetSortingEnabled(adminpanel.accessgridlist[1],false)
-- Populate the players gridlists
for id, player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(adminpanel.gridlist[1])
@@ -35,12 +37,14 @@ function onAdminPanelOpen()
guiGridListSetItemText (adminpanel.gridlist[3], row, adminpanel.column[8], getElementID(getElementData(vehicle,"parent")),false,false)
end
end
+ showGameplayVariables()
guiSetVisible(adminpanel.window[1],true)
guiSetEnabled(adminpanel.button[12],false)
guiSetEnabled(adminpanel.button[13],false)
guiSetEnabled(adminpanel.statbutton[1],false)
guiSetInputEnabled( true )
showCursor(true)
+ populateGridlistWithGameplayVariables()
end
addEvent("onAdminPanelOpen",true)
addEventHandler("onAdminPanelOpen",root,onAdminPanelOpen)
@@ -115,6 +119,7 @@ function onAdminPanelClose()
guiSetVisible(adminpanel.skinwindow[1],false)
guiSetInputEnabled( false )
showCursor(false)
+ gameplayVariablesTableC = {}
end
addEvent("onAdminPanelClose",true)
addEventHandler("onAdminPanelClose",root,onAdminPanelClose)
@@ -236,6 +241,63 @@ local playerName = guiGridListGetItemText (adminpanel.gridlist[5], guiGridListGe
end
end
+-- For Tab: "Admin Access"
+function showGameplayVariables()
+ local temp_gameplayVariablesTableC = exports.DayZ:getGameplayVariablesClient()
+ for i, data in pairs(temp_gameplayVariablesTableC) do
+ table.insert(gameplayVariablesTableC,{data[1],data[2],1})
+ end
+ temp_gameplayVariablesTableC = {}
+end
+
+function populateGridlistWithGameplayVariables()
+ for i, data in ipairs(gameplayVariablesTableC) do
+ for key, value in ipairs(variablesConversionTable) do
+ if value[1] == data[1] then
+ if value[2] ~= "Experimental" then
+ local row = guiGridListAddRow(adminpanel.accessgridlist[1])
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[1], value[2],false,false)
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[2], tostring(data[2]) ,false,false)
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[3], tostring(value[4]) ,false,false)
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[4], tostring(value[5]) ,false,false)
+ end
+ end
+ end
+ end
+end
+
+function onAdminAccessSendTable(theTable)
+ for i, data in ipairs(theTable) do
+ for key, value in ipairs(variablesConversionTable) do
+ if value[1] == data[1] then
+ if value[2] ~= "Experimental" then
+ local row = guiGridListAddRow(adminpanel.accessgridlist[1])
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[1], value[2],false,false)
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[2], tostring(data[2]) ,false,false)
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[3], tostring(value[4]) ,false,false)
+ guiGridListSetItemText (adminpanel.accessgridlist[1], row, adminpanel.accesscolumn[4], tostring(value[5]) ,false,false)
+ end
+ end
+ end
+ end
+end
+addEvent("onAdminAccessSendTable",true)
+addEventHandler("onAdminAccessSendTable",root,onAdminAccessSendTable)
+
+function changeDescriptionOnClick()
+ local selectedSetting = guiGridListGetItemText (adminpanel.accessgridlist[1], guiGridListGetSelectedItem (adminpanel.accessgridlist[1]),1)
+ if selectedSetting ~= "" then
+ for i, desc in ipairs(variablesConversionTable) do
+ if selectedSetting == desc[2] then
+ guiSetText(adminpanel.accessmemo[1],tostring(desc[3]))
+ end
+ end
+ end
+end
+
+function changeSetting()
+end
+
function killPlayerOnButtonClick()
local playerName = guiGridListGetItemText (adminpanel.gridlist[1], guiGridListGetSelectedItem (adminpanel.gridlist[1]),1)
if guiGridListGetItemText(adminpanel.gridlist[1], guiGridListGetSelectedItem(adminpanel.gridlist[1]), 1) ~= "" then
@@ -296,4 +358,63 @@ function getVehicleInfos(id)
return veh[2],veh[3], veh[4], veh[5], veh[6], veh[7],veh[8],veh[9], veh[10], veh[11], veh[12]
end
end
+end
+
+
+
+local expressionTable = {
+{nil,false},
+{false,false},
+{"false",false},
+{'"false"',false},
+{"",false},
+{'""',false},
+{0,false},
+{"0",false},
+{'"0"',false},
+{"nil",false},
+{'"nil"',false},
+
+{true,true},
+{"true",true},
+{'"true"',true},
+{1,true},
+{"1",true},
+{'"1"',true},
+}
+
+function toboolean(expression)
+local boolean = false
+ for i, expr in pairs(expressionTable) do
+ if expression == expr[1] then
+ boolean = expr[2]
+ return boolean
+ end
+ end
+end
+
+function editGameplayVariable(setting,environment,value)
+ for i, settings in ipairs(variablesConversionTable) do
+ if setting == settings[2] then
+ setting = settings[1]
+ break
+ end
+ end
+ if tonumber(value) ~= nil then
+ value = tonumber(value)
+ end
+ if value == "false" then
+ value = false
+ elseif value == "true" then
+ value = true
+ end
+ if environment == "Server" then
+ triggerServerEvent("onServerSideChangeSetting",root,tostring(setting),value)
+ elseif environment == "Client" then
+ exports.DayZ:setGameplayVariable(tostring(setting),value)
+ elseif environment == "Shared" then
+ triggerServerEvent("onServerSideChangeSetting",root,tostring(setting),value)
+ exports.DayZ:setGameplayVariable(tostring(setting),value)
+ end
+ outputChatBox("gameplayVariable "..tostring(setting).." has been set to: "..tostring(value),0,255,0,true)
end
\ No newline at end of file
diff --git a/dayzadmin/dayzadmin_gui.lua b/dayzadmin/dayzadmin_gui.lua
index 66f46ff..38bc2b2 100644
--- a/dayzadmin/dayzadmin_gui.lua
+++ b/dayzadmin/dayzadmin_gui.lua
@@ -8,644 +8,7 @@
]]
--- The DayZ Admin Panel GUI Table
-adminpanel = {
- tab = {},
- image = {},
- map = {},
- editbox = {},
- statedit = {},
- statvedit = {},
- skinedit = {},
- window = {},
- statwindow = {},
- statvwindow = {},
- skinwindow = {},
- vehwindow = {},
- label = {},
- statlabel = {},
- statvlabel = {},
- skinlabel = {},
- vehlabel = {},
- tabpanel = {},
- checkbox = {},
- gridlist = {},
- statgridlist = {},
- statvgridlist = {},
- skingridlist = {},
- vehgridlist = {},
- column = {},
- statcolumn = {},
- statvcolumn = {},
- skincolumn = {},
- vehcolumn = {},
- button = {},
- statbutton = {},
- statvbutton = {},
- skinbutton = {},
- vehbutton = {},
- combobox = {},
- statcombobox = {},
- statvcombobox = {},
- skincombobox = {},
- vehcombobox = {},
- memo = {}
-}
-
--- Items Table for Inventory Edito
-items =
-{
- ["Weapons"] = {
- "M1911",
- "Revolver",
- "Makarov PM",
- "Bizon PP-19 SD",
- "G17",
- "M9",
- "Makarov SD",
- "PDW",
- "MP5A5",
- "Lee Enfield",
- "AK-74",
- "AKS-74U",
- "RPK",
- "AKM",
- "Sa58V CCO",
- "Sa58V RCO",
- "FN FAL",
- "M24",
- "DMR",
- "M40A3",
- "G36A CAMO",
- "G36C",
- "G36C CAMO",
- "G36K CAMO",
- "L85A2 RIS Holo",
- "M16A2",
- "M16A2 M203",
- "M4A1",
- "M16A4",
- "CZ 550",
- "SVD Dragunov",
- "Mosin-Nagant",
- "Winchester 1866",
- "Double-barreled Shotgun",
- "M1014",
- "Remington 870",
- "Compound Crossbow",
- "Baseball Bat",
- "Crowbar",
- "Hatchet",
- "Machete",
- "Parachute",
- "Grenade",
- "Hunting Knife",
- "Binoculars",
- "Range Finder",
- "Shovel",
- "Flashlight",
- },
-
- ["Ammo"] = {
- "11.43x23mm Cartridge",
- "9x18mm Cartridge",
- "9x19mm Cartridge",
- ".303 British Cartridge",
- "5.45x39mm Cartridge",
- "7.62x39mm Cartridge",
- "7.62x51mm Cartridge",
- "5.56x45mm Cartridge",
- ".308 Winchester Cartridge",
- "7.62x54mm Cartridge",
- "1866 Slug",
- "12 Gauge Pellet",
- "Bolt",
- },
-
- ["Food/Drinks"] = {
- "Baked Beans",
- "Pasta",
- "Sardines",
- "Frank & Beans",
- "Can (Corn)",
- "Can (Peas)",
- "Can (Pork)",
- "Can (Stew)",
- "Can (Ravioli)",
- "Can (Fruit)",
- "Can (Chowder)",
- "MRE",
- "Pistachios",
- "Trail Mix",
- "Water Bottle",
- "Soda Can (Pepsi)",
- "Soda Can (Cola)",
- "Soda Can (Mountain Dew)",
- "Can (Milk)",
- "Raw Meat",
- "Cooked Meat",
- },
-
- ["Backpacks"] = {
- "Assault Pack (ACU)",
- "Czech Vest Pouch",
- "ALICE Pack",
- "Survival ACU",
- "British Assault Pack",
- "Backpack (Coyote)",
- "Czech Backpack",
- },
-
- ["Toolbelt"] = {
- "Box of Matches",
- "IR Goggles",
- "NV Goggles",
- "GPS",
- "Map",
- "Toolbox",
- "Watch",
- "Radio Device",
- "Compass"
- },
-
- ["Medical Items"] = {
- "Bandage",
- "Morphine",
- "Heat Pack",
- "Blood Bag",
- "Painkiller",
- "Antibiotics",
- "Epi-Pen",
- "Blood Bag (Empty)",
- "Blood Test Kit",
- "Blood Transfusion Kit",
- },
-
- ["Car Parts"] = {
- "Tire",
- "Engine",
- "Tank Parts",
- "Main Rotary Parts",
- "Windscreen Glass",
- "Scrap Metal",
- },
-
- ["Clothes"] = {
- "Military collar",
- "Africa collar",
- "Gold collar",
- "Silver collar",
- "LS collar",
- "Black Bandana (M)",
- "Blue Bandana (M)",
- "Green Bandana (M)",
- "Red Bandana (M)",
- "Black Bandana (H)",
- "Blue Bandana (H)",
- "Green Bandana (H)",
- "Red Bandana (H)",
- "Black Beret",
- "Red Beret",
- "Old Hat",
- "Black Hat",
- "Yellow Hat",
- "Black Trucker",
- "Blue Trucker",
- "Green Trucker",
- "Red Trucker",
- "Yellow Trucker",
- "Cow-Boy Hat",
- "White Hat",
- "Hockey Mask",
- "Black Shoe",
- "Sport Shoe",
- "Brown Shoe",
- "Biker Shoe",
- "Blue Shoe",
- "Red Shoe",
- "Beach Shoe",
- "Black Pants",
- "Beige Pants",
- "Gray Shorts",
- "Blue Shorts",
- "Blue Jeans",
- "Green Jeans",
- "Gray Pants",
- "Yellow Pants",
- "Blue Jogging",
- "Gray Jogging",
- "Military Pants",
- "Beige Vest",
- "Baseball Shirt",
- "Baseball 2 Shirt",
- "Red Vest",
- "Grey Shirt",
- "Green Vest",
- "Hawai Shirt",
- "Black Vest",
- "Brown Vest",
- "Biker Vest",
- "Blue Shirt",
- "Green 2 Vest",
- "Number 5 Shirt",
- "Monk Shirt",
- "Dark Glasses",
- "Square Glasses",
- "Red Glasses",
- },
-
- ["Blueprints"] = {
- "M4 Blueprint",
- "CZ 550 Blueprint",
- "Winchester 1866 Blueprint",
- "SPAZ-12 C. Shtgn. Blueprint",
- "Sawn-Off Shtgn. Blueprint",
- "AK-47 Blueprint",
- "Lee Enfield Blueprint",
- "Sporter 22 Blueprint",
- "Mosin 9130 Blueprint",
- "Crossbow Blueprint",
- "SKS Blueprint",
- "Blaze 95 D. R. Blueprint",
- "Remington 870 Blueprint",
- "FN FAL Blueprint",
- "G36C Blueprint",
- "Sa58V CCO Blueprint",
- "SVD Dragunov Blueprint",
- "DMR Blueprint",
- "M1911 Blueprint",
- "M9 SD Blueprint",
- "PDW Blueprint",
- "G17 Blueprint",
- "MP5A5 Blueprint",
- "Bizon PP-19 Blueprint",
- "Revolver Blueprint",
- "Desert Eagle Blueprint",
- "Hunting Knife Blueprint",
- "Hatchet Blueprint",
- "Baseball Bat Blueprint",
- "Shovel Blueprint",
- "Golf Club Blueprint",
- "Machete Blueprint",
- "Crowbar Blueprint",
- "Parachute Blueprint",
- "Tear Gas Blueprint",
- "Grenade Blueprint",
- "Binoculars Blueprint",
- ".45 ACP Cartridge Blueprint",
- "9x19mm SD Cartridge Blueprint",
- "9x19mm Cartridge Blueprint",
- "9x18mm Cartridge Blueprint",
- "5.45x39mm Cartridge Blueprint",
- "5.56x45mm Cartridge Blueprint",
- "1866 Slug Blueprint",
- "2Rnd. Slug Blueprint",
- "12 Gauge Pellet Blueprint",
- "9.3x62mm Cartridge Blueprint",
- ".303 British Cartridge Blueprint",
- "Bolt Blueprint",
- "Medic Kit Blueprint",
- "Wire Fence Blueprint",
- "Tent Blueprint",
- "Camouflage Clthng. Blueprint",
- "Survivor Clthng. Blueprint",
- "Civilian Clthng. Blueprint",
- "Ghillie Suit Blueprint",
- "Road Flare Blueprint",
- "Toolbox Blueprint",
- "Radio Device Blueprint",
- "IR Goggles Blueprint",
- "NV Goggles Blueprint",
- },
-
- ["Blueprint Parts"] = {
- "Gun Barrel",
- "Short Gun Barrel",
- "Gun Stock",
- "Thread",
- "Cloth",
- "Gun Powder",
- "Mechanical Supplies",
- "Cables",
- "Nails",
- "Sheet",
- "Barbed Wire",
- "Duct Tape",
- "Glue",
- "Drugs",
- "Bandaid",
- "Vitamins",
- "Tissue",
- "Small Box",
- "String",
- "Needle",
- "Microchips",
- "Optics",
- "Sharp Metal",
- "Handle",
- "Wooden Stick",
- "Hand Saw",
- "Metal Plate",
- "Metallic Stick",
- "Small Casing",
- "DIY (Wood)",
- "DIY (Metal)",
- "Log",
- "Stone",
- "Plank",
- "RSJ",
- "Metal Sheet",
- "Metal Sheet (Rusted)",
- },
-
- ["Other"] = {
- "Wood Pile",
- "Empty Gas Canister",
- "Full Gas Canister",
- "Road Flare",
- "Wire Fence",
- "Tent",
- "San Fierro Carrier Keycard",
- "Area 69 Keycard"
- },
-}
-
-playerDataTable = {
--- [[ Weapons ]] --
-{"M1911"},
-{"Revolver"},
-{"Makarov PM"},
-{"Bizon PP-19 SD"},
-{"G17"},
-{"M9"},
-{"Makarov SD"},
-{"PDW"},
-{"MP5A5"},
-{"Lee Enfield"},
-{"AK-74"},
-{"AKS-74U"},
-{"RPK"},
-{"AKM"},
-{"Sa58V CCO"},
-{"Sa58V RCO"},
-{"FN FAL"},
-{"M24"},
-{"DMR"},
-{"M40A3"},
-{"G36A CAMO"},
-{"G36C"},
-{"G36C CAMO"},
-{"G36K CAMO"},
-{"L85A2 RIS Holo"},
-{"M16A2"},
-{"M16A2 M203"},
-{"M4A1"},
-{"M16A4"},
-{"CZ 550"},
-{"SVD Dragunov"},
-{"Mosin-Nagant"},
-{"Winchester 1866"},
-{"Double-barreled Shotgun"},
-{"M1014"},
-{"Remington 870"},
-{"Compound Crossbow"},
-{"Baseball Bat"},
-{"Crowbar"},
-{"Hatchet"},
-{"Machete"},
-{"Parachute"},
-{"Grenade"},
-{"Hunting Knife"},
-{"Binoculars"},
-{"Range Finder"},
-{"Shovel"},
-{"Flashlight"},
--- [[ Ammo ]] --
-{"11.43x23mm Cartridge"},
-{"9x18mm Cartridge"},
-{"9x19mm Cartridge"},
-{".303 British Cartridge"},
-{"5.45x39mm Cartridge"},
-{"7.62x39mm Cartridge"},
-{"7.62x51mm Cartridge"},
-{"5.56x45mm Cartridge"},
-{".308 Winchester Cartridge"},
-{"7.62x54mm Cartridge"},
-{"1866 Slug"},
-{"12 Gauge Pellet"},
-{"Bolt"},
--- [[ Food / Drinks ]] --
-{"Baked Beans"},
-{"Pasta"},
-{"Sardines"},
-{"Frank & Beans"},
-{"Can (Corn)"},
-{"Can (Peas)"},
-{"Can (Pork)"},
-{"Can (Stew)"},
-{"Can (Ravioli)"},
-{"Can (Fruit)"},
-{"Can (Chowder)"},
-{"Pistachios"},
-{"Trail Mix"},
-{"MRE"},
-{"Water Bottle"},
-{"Soda Can (Pepsi)"},
-{"Soda Can (Cola)"},
-{"Soda Can (Mountain Dew)"},
-{"Can (Milk)"},
--- [[ Items ]] --
-{"Wood Pile"},
-{"Bandage"},
-{"Antibiotics"},
-{"Epi-Pen"},
-{"Road Flare"},
-{"Empty Gas Canister"},
-{"Full Gas Canister"},
-{"Heat Pack"},
-{"Painkiller"},
-{"Morphine"},
-{"Blood Bag"},
-{"Blood Bag (Empty)"},
-{"Transfusion Kit"},
-{"Blood Test Kit"},
-{"Wire Fence"},
-{"Raw Meat"},
-{"Tire"},
-{"Engine"},
-{"Tank Parts"},
-{"Scrap Metal"},
-{"Main Rotary Parts"},
-{"Windscreen Glass"},
-{"Tent"},
-{"Box of Matches"},
-{"Watch"},
-{"GPS"},
-{"Map"},
-{"Toolbox"},
-{"IR Goggles"},
-{"NV Goggles"},
-{"Cooked Meat"},
-{"Radio Device"},
-{"Compass"},
-{"Camouflage Clothing"},
-{"Civilian Clothing"},
-{"Survivor Clothing"},
-{"Survivor Clothing (Female)"},
-{"Civilian Clothing (Female)"},
-{"Ghillie Suit"},
-{"Empty Water Bottle"},
-{"Empty Soda Can"},
-{"Empty Tin Can"},
-{"Broken Whiskey Bottle"},
-{"Assault Pack (ACU)"},
-{"ALICE Pack"},
-{"British Assault Pack"},
-{"Czech Vest Pouch"},
-{"Backpack (Coyote)"},
-{"Czech Backpack"},
-{"Survival ACU"},
-{"San Fierro Carrier Keycard"},
-{"Area 69 Keycard"},
--- [[ Blueprints ]] --
-{"M4 Blueprint"},
-{"CZ 550 Blueprint"},
-{"Winchester 1866 Blueprint"},
-{"SPAZ-12 C. Shtgn. Blueprint"},
-{"Sawn-Off Shtgn. Blueprint"},
-{"AK-47 Blueprint"},
-{"Lee Enfield Blueprint"},
-{"Sporter 22 Blueprint"},
-{"Mosin 9130 Blueprint"},
-{"Crossbow Blueprint"},
-{"SKS Blueprint"},
-{"Blaze 95 D. R. Blueprint"},
-{"Remington 870 Blueprint"},
-{"FN FAL Blueprint"},
-{"G36C Blueprint"},
-{"Sa58V CCO Blueprint"},
-{"SVD Dragunov Blueprint"},
-{"DMR Blueprint"},
-{"M1911 Blueprint"},
-{"M9 SD Blueprint"},
-{"PDW Blueprint"},
-{"G17 Blueprint"},
-{"MP5A5 Blueprint"},
-{"Bizon PP-19 Blueprint"},
-{"Revolver Blueprint"},
-{"Desert Eagle Blueprint"},
-{"Hunting Knife Blueprint"},
-{"Hatchet Blueprint"},
-{"Baseball Bat Blueprint"},
-{"Shovel Blueprint"},
-{"Golf Club Blueprint"},
-{"Machete Blueprint"},
-{"Crowbar Blueprint"},
-{"Parachute Blueprint"},
-{"Tear Gas Blueprint"},
-{"Grenade Blueprint"},
-{"Binoculars Blueprint"},
-{".45 ACP Cartridge Blueprint"},
-{"9x19mm SD Cartridge Blueprint"},
-{"9x19mm Cartridge Blueprint"},
-{"9x18mm Cartridge Blueprint"},
-{"5.45x39mm Cartridge Blueprint"},
-{"5.56x45mm Cartridge Blueprint"},
-{"1866 Slug Blueprint"},
-{"2Rnd. Slug Blueprint"},
-{"12 Gauge Pellet Blueprint"},
-{"9.3x62mm Cartridge Blueprint"},
-{".303 British Cartridge Blueprint"},
-{"Bolt Blueprint"},
-{"Medic Kit Blueprint"},
-{"Wire Fence Blueprint"},
-{"Tent Blueprint"},
-{"Camouflage Clthng. Blueprint"},
-{"Survivor Clthng. Blueprint"},
-{"Civilian Clthng. Blueprint"},
-{"Ghillie Suit Blueprint"},
-{"Road Flare Blueprint"},
-{"Toolbox Blueprint"},
-{"Radio Device Blueprint"},
-{"IR Goggles Blueprint"},
-{"NV Goggles Blueprint"},
-{"Gun Barrel"},
-{"Short Gun Barrel"},
-{"Gun Stock"},
-{"Thread"},
-{"Cloth"},
-{"Gun Powder"},
-{"Mechanical Supplies"},
-{"Cables"},
-{"Nails"},
-{"Sheet"},
-{"Barbed Wire"},
-{"Duct Tape"},
-{"Glue"},
-{"Drugs"},
-{"Bandaid"},
-{"Vitamins"},
-{"Tissue"},
-{"Small Box"},
-{"String"},
-{"Needle"},
-{"Microchips"},
-{"Optics"},
-{"Sharp Metal"},
-{"Handle"},
-{"Wooden Stick"},
-{"Hand Saw"},
-{"Metal Plate"},
-{"Metallic Stick"},
-{"Small Casing"},
-
-{"DIY (Wood)"},
-{"DIY (Metal)"},
-{"Log"},
-{"Stone"},
-{"Plank"},
-{"RSJ"},
-{"Metal Sheet"},
-{"Metal Sheet (Rusted)"},
-}
-
-vehicleInfo = {
--- {Model, Wheels, Engine, TankParts, ScrapMetal, WindscreenGlass, RotaryParts, Name, ColsphereSize, Slots, Fuel,RealName}
-
--- VEHICLES
-{471,4,1,1,1,0,0,"ATV",2,50,30,"Quadbike"},
-{431,6,1,1,1,4,0,"Bus",5,50,100,"Bus"},
-{509,2,0,0,1,0,0,"Old Bike",2,0,0,"Bike"},
-{546,4,1,1,1,4,0,"GAZ",3,50,200,"Intruder"},
-{433,8,1,1,1,3,0,"Military Offroad",4,50,200,"Barracks"},
-{468,2,1,1,1,0,0,"Motorcycle",2,5,55,"Sanchez"},
-{543,4,1,1,1,4,0,"Offroad Pickup Truck",3,50,100,"Sadler"},
-{426,4,1,1,1,5,0,"Old Hatchback",3,50,50,"Premier"},
-{422,4,1,1,1,2,0,"Pickup Truck",3,50,200,"Bobcat"},
-{418,4,4,1,1,0,0,"S1203 Van",3,50,60,"Moonbeam"},
-{400,4,1,1,1,4,0,"Skoda",3,75,200,"Landstalker"},
-{531,4,1,1,1,3,0,"Tractor",3,50,100,"Tractor"},
-{470,4,1,1,1,6,0,"UAZ",3,50,100,"Patriot"},
-{455,6,1,1,1,0,0,"Ural Civilian",5,200,200,"Flatbed"},
-{490,4,1,1,1,4,0,"SUV",3,50,200,"FBI Rancher"},
-{478,6,1,1,1,0,0,"V3S Civilian",5,200,160,"Walton"},
-
--- AIRCRAFT
-{469,0,1,0,4,8,1,"AH6X Little Bird",7,20,1000,"Sparrow"},
-{417,0,1,0,4,8,1,"UH-1H Huey",7,50,1000,"Leviathan"},
-{487,0,1,0,4,8,1,"Mi-17",7,20,1000,"Maverick"},
-{488,0,1,0,2,4,1,"MH6J",7,20,600,"News Chopper"},
-{511,2,1,0,1,2,2,"An-2 Biplane",7,100,400,"Beagle"},
-
--- BOATS
-{453,0,1,0,1,2,0,"Fishing Boat",4,400,100,"Reefer"},
-{595,0,1,0,1,2,0,"Small Boat",3,0,100,"Launch"},
-{473,0,1,0,1,1,0,"PBX",2,0,100,"Dinghy"},
-}
-
local isItemSelected = false
-
-
addEventHandler("onClientResourceStart",root,
function()
adminpanel.window[1] = guiCreateWindow(0.08, 0.06, 0.83, 0.86, "DayZ Admin Panel", true)
@@ -785,7 +148,34 @@ function()
-- Admin Access (Soon)
adminpanel.tab[4] = guiCreateTab("Admin Access", adminpanel.tabpanel[1])
- adminpanel.label[69] = guiCreateLabel(0.01, 0.02, 0.31, 0.32, "SOON", true, adminpanel.tab[4])
+ adminpanel.accessgridlist[1] = guiCreateGridList(10, 24, 622, 247, false, adminpanel.tab[4])
+ adminpanel.accesscolumn[1] = guiGridListAddColumn(adminpanel.accessgridlist[1], "Setting", 0.4)
+ adminpanel.accesscolumn[2] = guiGridListAddColumn(adminpanel.accessgridlist[1], "Value", 0.2)
+ adminpanel.accesscolumn[3] = guiGridListAddColumn(adminpanel.accessgridlist[1], "Default", 0.2)
+ adminpanel.accesscolumn[4] = guiGridListAddColumn(adminpanel.accessgridlist[1], "Environment", 0.2)
+ adminpanel.accessbutton[1] = guiCreateButton(0.02, 0.63, 0.12, 0.07, "Edit Setting", true, adminpanel.tab[4])
+ adminpanel.accessbutton[2] = guiCreateButton(0.02, 0.72, 0.12, 0.07, "Reset Setting", true, adminpanel.tab[4])
+ adminpanel.accessmemo[1] = guiCreateMemo(0.59, 0.62, 0.39, 0.36, "", true, adminpanel.tab[4])
+ guiMemoSetReadOnly(adminpanel.accessmemo[1], true)
+ adminpanel.accesslabel[1] = guiCreateLabel(0.02, 0.85, 0.56, 0.10, "In \"Admin Access\", various settings of DayZ can be altered. Exercise extreme caution when editing these settings! \nSettings changed here will not be saved!", true, adminpanel.tab[4])
+ guiSetFont(adminpanel.accesslabel[1], "default-bold-small")
+ guiLabelSetColor(adminpanel.accesslabel[1], 255, 0, 0)
+ guiLabelSetHorizontalAlign(adminpanel.accesslabel[1], "left", true)
+
+ -- Admin Access Edit Setting
+ adminpanel.accesseditwindow[1] = guiCreateWindow(0.25, 0.38, 0.46, 0.27, "Edit Setting: [SETTING]", true)
+ guiWindowSetSizable(adminpanel.accesseditwindow[1], false)
+ guiSetAlpha(adminpanel.accesseditwindow[1], 1.00)
+
+ adminpanel.accessedit[1] = guiCreateEdit(0.03, 0.36, 0.59, 0.16, "", true, adminpanel.accesseditwindow[1])
+ adminpanel.accesseditlabel[1] = guiCreateLabel(0.03, 0.15, 0.57, 0.21, "Allowed values: [VALUES]", true, adminpanel.accesseditwindow[1])
+ guiLabelSetVerticalAlign(adminpanel.label[1], "center")
+ adminpanel.accesseditbutton[1] = guiCreateButton(0.89, 0.76, 0.08, 0.17, "x", true, adminpanel.accesseditwindow[1])
+ adminpanel.accesseditbutton[2] = guiCreateButton(0.03, 0.76, 0.20, 0.17, "Save", true, adminpanel.accesseditwindow[1])
+ adminpanel.accesseditlabel[2] = guiCreateLabel(0.65, 0.16, 0.32, 0.57, "Be careful when editing settings - giving them the wrong value may result in the game breaking!", true, adminpanel.accesseditwindow[1])
+ guiSetFont(adminpanel.accesseditlabel[2], "default-bold-small")
+ guiLabelSetColor(adminpanel.accesseditlabel[2], 255, 0, 0)
+ guiLabelSetHorizontalAlign(adminpanel.accesseditlabel[2], "left", true)
-- Live Map
adminpanel.tab[5] = guiCreateTab("Live Map", adminpanel.tabpanel[1])
@@ -809,6 +199,8 @@ function()
-- Search (Soon)
adminpanel.tab[6] = guiCreateTab("Search", adminpanel.tabpanel[1])
adminpanel.label[76] = guiCreateLabel(0.01, 0.02, 0.37, 0.41, "SOON", true, adminpanel.tab[6])
+
+
-- Leaderboard (Soon)
adminpanel.tab[7] = guiCreateTab("Leaderboard", adminpanel.tabpanel[1])
@@ -926,6 +318,7 @@ function()
guiSetVisible(adminpanel.statvwindow[1],false)
guiSetVisible(adminpanel.skinwindow[1],false)
guiSetVisible(adminpanel.vehwindow[1],false)
+ guiSetVisible(adminpanel.accesseditwindow[1],false)
guiSetEnabled(adminpanel.button[12],false)
guiSetEnabled(adminpanel.button[13],false)
@@ -933,7 +326,7 @@ function()
guiSetEnabled(adminpanel.statvbutton[1],false)
guiSetEnabled(adminpanel.skinbutton[1],false)
--guiSetEnabled(adminpanel.tab[2],false)
- guiSetEnabled(adminpanel.tab[4],false)
+ guiSetEnabled(adminpanel.tab[4],true)
guiSetEnabled(adminpanel.tab[6],false)
guiSetEnabled(adminpanel.tab[7],false)
@@ -1046,6 +439,57 @@ function()
end
end, false)
+ addEventHandler("onClientGUIClick", adminpanel.accessbutton[1],
+ function()
+ local setting = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 1)
+ local value = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 2)
+ local environment = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 4)
+ if setting ~= "" then
+ guiSetVisible(adminpanel.accesseditwindow[1],true)
+ guiSetText(adminpanel.accesseditwindow[1],"Edit Setting: "..tostring(setting).." ("..tostring(environment)..")")
+ for i, value in ipairs(variablesConversionTable) do
+ if setting == value[2] then
+ guiSetText(adminpanel.accesseditlabel[1],"Allowed Values: "..tostring(value[6]))
+ break
+ end
+ end
+ guiBringToFront(adminpanel.accesseditwindow[1])
+ end
+ end, false)
+
+ addEventHandler("onClientGUIClick", adminpanel.accessbutton[2],
+ function()
+ local setting = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 1)
+ local value = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 2)
+ local environment = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 4)
+ if setting ~= "" then
+ for i, value in ipairs(variablesConversionTable) do
+ if setting == value[2] then
+ if environment == "Server" then
+ triggerServerEvent("onServerSideChangeSetting",root,tostring(setting),value[4])
+ elseif environment == "Client" then
+ exports.DayZ:setGameplayVariable(tostring(setting),value[4])
+ elseif environment == "Shared" then
+ triggerServerEvent("onServerSideChangeSetting",root,tostring(setting),value[4])
+ exports.DayZ:setGameplayVariable(tostring(setting),value[4])
+ end
+ outputChatBox("Setting "..tostring(setting).." has been reset to: "..tostring(value[4]))
+ end
+ end
+ end
+ end, false)
+
+ addEventHandler("onClientGUIClick", adminpanel.accesseditbutton[2],
+ function()
+ local setting = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 1)
+ local environment = guiGridListGetItemText(adminpanel.accessgridlist[1], guiGridListGetSelectedItem(adminpanel.accessgridlist[1]), 4)
+ local editedSetting = guiGetText(adminpanel.accessedit[1])
+ if editedSetting ~= "" then
+ editGameplayVariable(setting,environment,editedSetting)
+ guiSetVisible(adminpanel.accesseditwindow[1],false)
+ end
+ end, false)
+
addEventHandler("onClientGUIClick", adminpanel.button[14],
function()
local message = tostring(guiGetText(adminpanel.editbox[2]))
@@ -1127,6 +571,8 @@ function()
end, false)
addEventHandler("onClientGUIClick",adminpanel.gridlist[1],function() guiGridListClear(adminpanel.gridlist[2]) populateStatsOnPlayerSelect() end,false)
+ addEventHandler("onClientGUIClick",adminpanel.accessgridlist[1],changeDescriptionOnClick,false)
+ addEventHandler("onClientGUIClick", adminpanel.accesseditbutton[1],function() guiSetVisible(adminpanel.accesseditwindow[1],false) end,false)
addEventHandler("onClientGUIClick",adminpanel.gridlist[5],function() guiGridListClear(adminpanel.gridlist[6]) showPlayerInventory() end,false)
addEventHandler("onClientGUIClick",adminpanel.gridlist[3],populateStatsOnVehicleSelect,false)
addEventHandler("onClientGUIClick",adminpanel.gridlist[5],checkIfRequirementsMet,false)
diff --git a/dayzadmin/dayzadmin_s.lua b/dayzadmin/dayzadmin_s.lua
index 00aac17..abc7f55 100644
--- a/dayzadmin/dayzadmin_s.lua
+++ b/dayzadmin/dayzadmin_s.lua
@@ -7,40 +7,6 @@
*/
]]
-local vehicleInfo = {
--- {Model, Wheels, Engine, TankParts, ScrapMetal, WindscreenGlass, RotaryParts, Name, ColsphereSize, Slots, Fuel,RealName}
-
--- VEHICLES
-{471,4,1,1,1,0,0,"ATV",2,50,30,"Quadbike"},
-{431,6,1,1,1,4,0,"Bus",5,50,100,"Bus"},
-{509,2,0,0,1,0,0,"Old Bike",2,0,0,"Bike"},
-{546,4,1,1,1,4,0,"GAZ",3,50,200,"Intruder"},
-{433,8,1,1,1,3,0,"Military Offroad",4,50,200,"Barracks"},
-{468,2,1,1,1,0,0,"Motorcycle",2,5,55,"Sanchez"},
-{543,4,1,1,1,4,0,"Offroad Pickup Truck",3,50,100,"Sadler"},
-{426,4,1,1,1,5,0,"Old Hatchback",3,50,50,"Premier"},
-{422,4,1,1,1,2,0,"Pickup Truck",3,50,200,"Bobcat"},
-{418,4,4,1,1,0,0,"S1203 Van",3,50,60,"Moonbeam"},
-{400,4,1,1,1,4,0,"Skoda",3,75,200,"Landstalker"},
-{531,4,1,1,1,3,0,"Tractor",3,50,100,"Tractor"},
-{470,4,1,1,1,6,0,"UAZ",3,50,100,"Patriot"},
-{455,6,1,1,1,0,0,"Ural Civilian",5,200,200,"Flatbed"},
-{490,4,1,1,1,4,0,"SUV",3,50,200,"FBI Rancher"},
-{478,6,1,1,1,0,0,"V3S Civilian",5,200,160,"Walton"},
-
--- AIRCRAFT
-{469,0,1,0,4,8,1,"AH6X Little Bird",7,20,1000,"Sparrow"},
-{417,0,1,0,4,8,1,"UH-1H Huey",7,50,1000,"Leviathan"},
-{487,0,1,0,4,8,1,"Mi-17",7,20,1000,"Maverick"},
-{488,0,1,0,2,4,1,"MH6J",7,20,600,"News Chopper"},
-{511,2,1,0,1,2,2,"An-2 Biplane",7,100,400,"Beagle"},
-
--- BOATS
-{453,0,1,0,1,2,0,"Fishing Boat",4,400,100,"Reefer"},
-{595,0,1,0,1,2,0,"Small Boat",3,0,100,"Launch"},
-{473,0,1,0,1,1,0,"PBX",2,0,100,"Dinghy"},
-}
-
function getVehicleInfos(id)
for i,veh in ipairs(vehicleInfo) do
if veh[1] == id then
@@ -69,10 +35,15 @@ function openDayZAdminPanel (player,cmd)
bindIsOn = true
end
triggerClientEvent (player, "onAdminPanelOpen", root)
+ for i, data in pairs(exports.DayZ:getGameplayVariablesServer()) do
+ table.insert(gameplayVariablesTableS,{data[1],data[2],2})
+ end
+ triggerClientEvent(player,"onAdminAccessSendTable",root,gameplayVariablesTableS)
PanelIsOpen = true
else
triggerClientEvent (player, "onAdminPanelClose", root)
PanelIsOpen = false
+ gameplayVariablesTableS = {}
end
end
end
@@ -245,3 +216,9 @@ function onAdminPanelKillVehicle(id)
end
addEvent("onAdminPanelKillVehicle",true)
addEventHandler("onAdminPanelKillVehicle",root,onAdminPanelKillVehicle)
+
+function onServerSideChangeSetting(setting,value)
+ exports.DayZ:setGameplayVariable(tostring(setting),value)
+end
+addEvent("onServerSideChangeSetting",true)
+addEventHandler("onServerSideChangeSetting",root,onServerSideChangeSetting)
diff --git a/dayzadmin/dayzadmin_table.lua b/dayzadmin/dayzadmin_table.lua
new file mode 100644
index 0000000..ec98349
--- /dev/null
+++ b/dayzadmin/dayzadmin_table.lua
@@ -0,0 +1,727 @@
+--[[
+/**
+ Name: DayZ Admin Panel
+ Author: L
+ Version: 1.0.0
+ Description: Comprehensive administration tool for MTA DayZ
+*/
+]]
+
+
+
+-- The DayZ Admin Panel GUI Table
+adminpanel = {
+ tab = {},
+ image = {},
+ map = {},
+ editbox = {},
+ statedit = {},
+ statvedit = {},
+ skinedit = {},
+ window = {},
+ statwindow = {},
+ statvwindow = {},
+ skinwindow = {},
+ vehwindow = {},
+ label = {},
+ statlabel = {},
+ statvlabel = {},
+ skinlabel = {},
+ vehlabel = {},
+ tabpanel = {},
+ checkbox = {},
+ gridlist = {},
+ statgridlist = {},
+ statvgridlist = {},
+ skingridlist = {},
+ vehgridlist = {},
+ column = {},
+ statcolumn = {},
+ statvcolumn = {},
+ skincolumn = {},
+ vehcolumn = {},
+ button = {},
+ statbutton = {},
+ statvbutton = {},
+ skinbutton = {},
+ vehbutton = {},
+ combobox = {},
+ statcombobox = {},
+ statvcombobox = {},
+ skincombobox = {},
+ vehcombobox = {},
+ memo = {},
+ accesslabel = {},
+ accessmemo = {},
+ accessbutton = {},
+ accessgridlist = {},
+ accesscolumn = {},
+ accesseditwindow = {},
+ accessedit = {},
+ accesseditlabel = {},
+ accesseditbutton = {},
+
+}
+
+-- Items Table for Inventory Edito
+items =
+{
+ ["Weapons"] = {
+ "M1911",
+ "Revolver",
+ "Makarov PM",
+ "Bizon PP-19 SD",
+ "G17",
+ "M9",
+ "Makarov SD",
+ "PDW",
+ "MP5A5",
+ "Lee Enfield",
+ "AK-74",
+ "AKS-74U",
+ "RPK",
+ "AKM",
+ "Sa58V CCO",
+ "Sa58V RCO",
+ "FN FAL",
+ "M24",
+ "DMR",
+ "M40A3",
+ "G36A CAMO",
+ "G36C",
+ "G36C CAMO",
+ "G36K CAMO",
+ "L85A2 RIS Holo",
+ "M16A2",
+ "M16A2 M203",
+ "M4A1",
+ "M16A4",
+ "CZ 550",
+ "SVD Dragunov",
+ "Mosin-Nagant",
+ "Winchester 1866",
+ "Double-barreled Shotgun",
+ "M1014",
+ "Remington 870",
+ "Compound Crossbow",
+ "Baseball Bat",
+ "Crowbar",
+ "Hatchet",
+ "Machete",
+ "Parachute",
+ "Grenade",
+ "Hunting Knife",
+ "Binoculars",
+ "Range Finder",
+ "Shovel",
+ "Flashlight",
+ },
+
+ ["Ammo"] = {
+ "11.43x23mm Cartridge",
+ "9x18mm Cartridge",
+ "9x19mm Cartridge",
+ ".303 British Cartridge",
+ "5.45x39mm Cartridge",
+ "7.62x39mm Cartridge",
+ "7.62x51mm Cartridge",
+ "5.56x45mm Cartridge",
+ ".308 Winchester Cartridge",
+ "7.62x54mm Cartridge",
+ "1866 Slug",
+ "12 Gauge Pellet",
+ "Bolt",
+ },
+
+ ["Food/Drinks"] = {
+ "Baked Beans",
+ "Pasta",
+ "Sardines",
+ "Frank & Beans",
+ "Can (Corn)",
+ "Can (Peas)",
+ "Can (Pork)",
+ "Can (Stew)",
+ "Can (Ravioli)",
+ "Can (Fruit)",
+ "Can (Chowder)",
+ "MRE",
+ "Pistachios",
+ "Trail Mix",
+ "Water Bottle",
+ "Soda Can (Pepsi)",
+ "Soda Can (Cola)",
+ "Soda Can (Mountain Dew)",
+ "Can (Milk)",
+ "Raw Meat",
+ "Cooked Meat",
+ },
+
+ ["Backpacks"] = {
+ "Assault Pack (ACU)",
+ "Czech Vest Pouch",
+ "ALICE Pack",
+ "Survival ACU",
+ "British Assault Pack",
+ "Backpack (Coyote)",
+ "Czech Backpack",
+ },
+
+ ["Toolbelt"] = {
+ "Box of Matches",
+ "IR Goggles",
+ "NV Goggles",
+ "GPS",
+ "Map",
+ "Toolbox",
+ "Watch",
+ "Radio Device",
+ "Compass"
+ },
+
+ ["Medical Items"] = {
+ "Bandage",
+ "Morphine",
+ "Heat Pack",
+ "Blood Bag",
+ "Painkiller",
+ "Antibiotics",
+ "Epi-Pen",
+ "Blood Bag (Empty)",
+ "Blood Test Kit",
+ "Blood Transfusion Kit",
+ },
+
+ ["Car Parts"] = {
+ "Tire",
+ "Engine",
+ "Tank Parts",
+ "Main Rotary Parts",
+ "Windscreen Glass",
+ "Scrap Metal",
+ },
+
+ ["Clothes"] = {
+ "Survivor Clothing",
+ "Survivor Clothing (Female)",
+ "Camouflage Clothing",
+ "Civilian Clothing",
+ "Civilian Clothing (Female)",
+ "Ghillie Suit",
+ "Military collar",
+ "Africa collar",
+ "Gold collar",
+ "Silver collar",
+ "LS collar",
+ "Black Bandana (M)",
+ "Blue Bandana (M)",
+ "Green Bandana (M)",
+ "Red Bandana (M)",
+ "Black Bandana (H)",
+ "Blue Bandana (H)",
+ "Green Bandana (H)",
+ "Red Bandana (H)",
+ "Black Beret",
+ "Red Beret",
+ "Old Hat",
+ "Black Hat",
+ "Yellow Hat",
+ "Black Trucker",
+ "Blue Trucker",
+ "Green Trucker",
+ "Red Trucker",
+ "Yellow Trucker",
+ "Cow-Boy Hat",
+ "White Hat",
+ "Hockey Mask",
+ "Black Shoe",
+ "Sport Shoe",
+ "Brown Shoe",
+ "Biker Shoe",
+ "Blue Shoe",
+ "Red Shoe",
+ "Beach Shoe",
+ "Black Pants",
+ "Beige Pants",
+ "Gray Shorts",
+ "Blue Shorts",
+ "Blue Jeans",
+ "Green Jeans",
+ "Gray Pants",
+ "Yellow Pants",
+ "Blue Jogging",
+ "Gray Jogging",
+ "Military Pants",
+ "Beige Vest",
+ "Baseball Shirt",
+ "Baseball 2 Shirt",
+ "Red Vest",
+ "Grey Shirt",
+ "Green Vest",
+ "Hawai Shirt",
+ "Black Vest",
+ "Brown Vest",
+ "Biker Vest",
+ "Blue Shirt",
+ "Green 2 Vest",
+ "Number 5 Shirt",
+ "Monk Shirt",
+ "Dark Glasses",
+ "Square Glasses",
+ "Red Glasses",
+ },
+
+ ["Blueprints"] = {
+ "M4 Blueprint",
+ "CZ 550 Blueprint",
+ "Winchester 1866 Blueprint",
+ "SPAZ-12 C. Shtgn. Blueprint",
+ "Sawn-Off Shtgn. Blueprint",
+ "AK-47 Blueprint",
+ "Lee Enfield Blueprint",
+ "Sporter 22 Blueprint",
+ "Mosin 9130 Blueprint",
+ "Crossbow Blueprint",
+ "SKS Blueprint",
+ "Blaze 95 D. R. Blueprint",
+ "Remington 870 Blueprint",
+ "FN FAL Blueprint",
+ "G36C Blueprint",
+ "Sa58V CCO Blueprint",
+ "SVD Dragunov Blueprint",
+ "DMR Blueprint",
+ "M1911 Blueprint",
+ "M9 SD Blueprint",
+ "PDW Blueprint",
+ "G17 Blueprint",
+ "MP5A5 Blueprint",
+ "Bizon PP-19 Blueprint",
+ "Revolver Blueprint",
+ "Desert Eagle Blueprint",
+ "Hunting Knife Blueprint",
+ "Hatchet Blueprint",
+ "Baseball Bat Blueprint",
+ "Shovel Blueprint",
+ "Golf Club Blueprint",
+ "Machete Blueprint",
+ "Crowbar Blueprint",
+ "Parachute Blueprint",
+ "Tear Gas Blueprint",
+ "Grenade Blueprint",
+ "Binoculars Blueprint",
+ ".45 ACP Cartridge Blueprint",
+ "9x19mm SD Cartridge Blueprint",
+ "9x19mm Cartridge Blueprint",
+ "9x18mm Cartridge Blueprint",
+ "5.45x39mm Cartridge Blueprint",
+ "5.56x45mm Cartridge Blueprint",
+ "1866 Slug Blueprint",
+ "2Rnd. Slug Blueprint",
+ "12 Gauge Pellet Blueprint",
+ "9.3x62mm Cartridge Blueprint",
+ ".303 British Cartridge Blueprint",
+ "Bolt Blueprint",
+ "Medic Kit Blueprint",
+ "Wire Fence Blueprint",
+ "Tent Blueprint",
+ "Camouflage Clthng. Blueprint",
+ "Survivor Clthng. Blueprint",
+ "Civilian Clthng. Blueprint",
+ "Ghillie Suit Blueprint",
+ "Road Flare Blueprint",
+ "Toolbox Blueprint",
+ "Radio Device Blueprint",
+ "IR Goggles Blueprint",
+ "NV Goggles Blueprint",
+ },
+
+ ["Blueprint Parts"] = {
+ "Gun Barrel",
+ "Short Gun Barrel",
+ "Gun Stock",
+ "Thread",
+ "Cloth",
+ "Gun Powder",
+ "Mechanical Supplies",
+ "Cables",
+ "Nails",
+ "Sheet",
+ "Barbed Wire",
+ "Duct Tape",
+ "Glue",
+ "Drugs",
+ "Bandaid",
+ "Vitamins",
+ "Tissue",
+ "Small Box",
+ "String",
+ "Needle",
+ "Microchips",
+ "Optics",
+ "Sharp Metal",
+ "Handle",
+ "Wooden Stick",
+ "Hand Saw",
+ "Metal Plate",
+ "Metallic Stick",
+ "Small Casing",
+ "DIY (Wood)",
+ "DIY (Metal)",
+ "Log",
+ "Stone",
+ "Plank",
+ "RSJ",
+ "Metal Sheet",
+ "Metal Sheet (Rusted)",
+ },
+
+ ["Other"] = {
+ "Wood Pile",
+ "Empty Gas Canister",
+ "Full Gas Canister",
+ "Road Flare",
+ "Wire Fence",
+ "Tent",
+ "San Fierro Carrier Keycard",
+ "Area 69 Keycard"
+ },
+}
+
+playerDataTable = {
+-- [[ Weapons ]] --
+{"M1911"},
+{"Revolver"},
+{"Makarov PM"},
+{"Bizon PP-19 SD"},
+{"G17"},
+{"M9"},
+{"Makarov SD"},
+{"PDW"},
+{"MP5A5"},
+{"Lee Enfield"},
+{"AK-74"},
+{"AKS-74U"},
+{"RPK"},
+{"AKM"},
+{"Sa58V CCO"},
+{"Sa58V RCO"},
+{"FN FAL"},
+{"M24"},
+{"DMR"},
+{"M40A3"},
+{"G36A CAMO"},
+{"G36C"},
+{"G36C CAMO"},
+{"G36K CAMO"},
+{"L85A2 RIS Holo"},
+{"M16A2"},
+{"M16A2 M203"},
+{"M4A1"},
+{"M16A4"},
+{"CZ 550"},
+{"SVD Dragunov"},
+{"Mosin-Nagant"},
+{"Winchester 1866"},
+{"Double-barreled Shotgun"},
+{"M1014"},
+{"Remington 870"},
+{"Compound Crossbow"},
+{"Baseball Bat"},
+{"Crowbar"},
+{"Hatchet"},
+{"Machete"},
+{"Parachute"},
+{"Grenade"},
+{"Hunting Knife"},
+{"Binoculars"},
+{"Range Finder"},
+{"Shovel"},
+{"Flashlight"},
+-- [[ Ammo ]] --
+{"11.43x23mm Cartridge"},
+{"9x18mm Cartridge"},
+{"9x19mm Cartridge"},
+{".303 British Cartridge"},
+{"5.45x39mm Cartridge"},
+{"7.62x39mm Cartridge"},
+{"7.62x51mm Cartridge"},
+{"5.56x45mm Cartridge"},
+{".308 Winchester Cartridge"},
+{"7.62x54mm Cartridge"},
+{"1866 Slug"},
+{"12 Gauge Pellet"},
+{"Bolt"},
+-- [[ Food / Drinks ]] --
+{"Baked Beans"},
+{"Pasta"},
+{"Sardines"},
+{"Frank & Beans"},
+{"Can (Corn)"},
+{"Can (Peas)"},
+{"Can (Pork)"},
+{"Can (Stew)"},
+{"Can (Ravioli)"},
+{"Can (Fruit)"},
+{"Can (Chowder)"},
+{"Pistachios"},
+{"Trail Mix"},
+{"MRE"},
+{"Water Bottle"},
+{"Soda Can (Pepsi)"},
+{"Soda Can (Cola)"},
+{"Soda Can (Mountain Dew)"},
+{"Can (Milk)"},
+-- [[ Items ]] --
+{"Wood Pile"},
+{"Bandage"},
+{"Antibiotics"},
+{"Epi-Pen"},
+{"Road Flare"},
+{"Empty Gas Canister"},
+{"Full Gas Canister"},
+{"Heat Pack"},
+{"Painkiller"},
+{"Morphine"},
+{"Blood Bag"},
+{"Blood Bag (Empty)"},
+{"Transfusion Kit"},
+{"Blood Test Kit"},
+{"Wire Fence"},
+{"Raw Meat"},
+{"Tire"},
+{"Engine"},
+{"Tank Parts"},
+{"Scrap Metal"},
+{"Main Rotary Parts"},
+{"Windscreen Glass"},
+{"Tent"},
+{"Box of Matches"},
+{"Watch"},
+{"GPS"},
+{"Map"},
+{"Toolbox"},
+{"IR Goggles"},
+{"NV Goggles"},
+{"Cooked Meat"},
+{"Radio Device"},
+{"Compass"},
+{"Camouflage Clothing"},
+{"Civilian Clothing"},
+{"Survivor Clothing"},
+{"Survivor Clothing (Female)"},
+{"Civilian Clothing (Female)"},
+{"Ghillie Suit"},
+{"Empty Water Bottle"},
+{"Empty Soda Can"},
+{"Empty Tin Can"},
+{"Broken Whiskey Bottle"},
+{"Assault Pack (ACU)"},
+{"ALICE Pack"},
+{"British Assault Pack"},
+{"Czech Vest Pouch"},
+{"Backpack (Coyote)"},
+{"Czech Backpack"},
+{"Survival ACU"},
+{"San Fierro Carrier Keycard"},
+{"Area 69 Keycard"},
+-- [[ Blueprints ]] --
+{"M4 Blueprint"},
+{"CZ 550 Blueprint"},
+{"Winchester 1866 Blueprint"},
+{"SPAZ-12 C. Shtgn. Blueprint"},
+{"Sawn-Off Shtgn. Blueprint"},
+{"AK-47 Blueprint"},
+{"Lee Enfield Blueprint"},
+{"Sporter 22 Blueprint"},
+{"Mosin 9130 Blueprint"},
+{"Crossbow Blueprint"},
+{"SKS Blueprint"},
+{"Blaze 95 D. R. Blueprint"},
+{"Remington 870 Blueprint"},
+{"FN FAL Blueprint"},
+{"G36C Blueprint"},
+{"Sa58V CCO Blueprint"},
+{"SVD Dragunov Blueprint"},
+{"DMR Blueprint"},
+{"M1911 Blueprint"},
+{"M9 SD Blueprint"},
+{"PDW Blueprint"},
+{"G17 Blueprint"},
+{"MP5A5 Blueprint"},
+{"Bizon PP-19 Blueprint"},
+{"Revolver Blueprint"},
+{"Desert Eagle Blueprint"},
+{"Hunting Knife Blueprint"},
+{"Hatchet Blueprint"},
+{"Baseball Bat Blueprint"},
+{"Shovel Blueprint"},
+{"Golf Club Blueprint"},
+{"Machete Blueprint"},
+{"Crowbar Blueprint"},
+{"Parachute Blueprint"},
+{"Tear Gas Blueprint"},
+{"Grenade Blueprint"},
+{"Binoculars Blueprint"},
+{".45 ACP Cartridge Blueprint"},
+{"9x19mm SD Cartridge Blueprint"},
+{"9x19mm Cartridge Blueprint"},
+{"9x18mm Cartridge Blueprint"},
+{"5.45x39mm Cartridge Blueprint"},
+{"5.56x45mm Cartridge Blueprint"},
+{"1866 Slug Blueprint"},
+{"2Rnd. Slug Blueprint"},
+{"12 Gauge Pellet Blueprint"},
+{"9.3x62mm Cartridge Blueprint"},
+{".303 British Cartridge Blueprint"},
+{"Bolt Blueprint"},
+{"Medic Kit Blueprint"},
+{"Wire Fence Blueprint"},
+{"Tent Blueprint"},
+{"Camouflage Clthng. Blueprint"},
+{"Survivor Clthng. Blueprint"},
+{"Civilian Clthng. Blueprint"},
+{"Ghillie Suit Blueprint"},
+{"Road Flare Blueprint"},
+{"Toolbox Blueprint"},
+{"Radio Device Blueprint"},
+{"IR Goggles Blueprint"},
+{"NV Goggles Blueprint"},
+{"Gun Barrel"},
+{"Short Gun Barrel"},
+{"Gun Stock"},
+{"Thread"},
+{"Cloth"},
+{"Gun Powder"},
+{"Mechanical Supplies"},
+{"Cables"},
+{"Nails"},
+{"Sheet"},
+{"Barbed Wire"},
+{"Duct Tape"},
+{"Glue"},
+{"Drugs"},
+{"Bandaid"},
+{"Vitamins"},
+{"Tissue"},
+{"Small Box"},
+{"String"},
+{"Needle"},
+{"Microchips"},
+{"Optics"},
+{"Sharp Metal"},
+{"Handle"},
+{"Wooden Stick"},
+{"Hand Saw"},
+{"Metal Plate"},
+{"Metallic Stick"},
+{"Small Casing"},
+
+{"DIY (Wood)"},
+{"DIY (Metal)"},
+{"Log"},
+{"Stone"},
+{"Plank"},
+{"RSJ"},
+{"Metal Sheet"},
+{"Metal Sheet (Rusted)"},
+}
+
+vehicleInfo = {
+-- {Model, Wheels, Engine, TankParts, ScrapMetal, WindscreenGlass, RotaryParts, Name, ColsphereSize, Slots, Fuel,RealName}
+
+-- VEHICLES
+{471,4,1,1,1,0,0,"ATV",2,50,30,"Quadbike"},
+{431,6,1,1,1,4,0,"Bus",5,50,100,"Bus"},
+{509,2,0,0,1,0,0,"Old Bike",2,0,0,"Bike"},
+{546,4,1,1,1,4,0,"GAZ",3,50,200,"Intruder"},
+{433,8,1,1,1,3,0,"Military Offroad",4,50,200,"Barracks"},
+{468,2,1,1,1,0,0,"Motorcycle",2,5,55,"Sanchez"},
+{543,4,1,1,1,4,0,"Offroad Pickup Truck",3,50,100,"Sadler"},
+{426,4,1,1,1,5,0,"Old Hatchback",3,50,50,"Premier"},
+{422,4,1,1,1,2,0,"Pickup Truck",3,50,200,"Bobcat"},
+{418,4,4,1,1,0,0,"S1203 Van",3,50,60,"Moonbeam"},
+{400,4,1,1,1,4,0,"Skoda",3,75,200,"Landstalker"},
+{531,4,1,1,1,3,0,"Tractor",3,50,100,"Tractor"},
+{470,4,1,1,1,6,0,"UAZ",3,50,100,"Patriot"},
+{455,6,1,1,1,0,0,"Ural Civilian",5,200,200,"Flatbed"},
+{490,4,1,1,1,4,0,"SUV",3,50,200,"FBI Rancher"},
+{478,6,1,1,1,0,0,"V3S Civilian",5,200,160,"Walton"},
+
+-- AIRCRAFT
+{469,0,1,0,4,8,1,"AH6X Little Bird",7,20,1000,"Sparrow"},
+{417,0,1,0,4,8,1,"UH-1H Huey",7,50,1000,"Leviathan"},
+{487,0,1,0,4,8,1,"Mi-17",7,20,1000,"Maverick"},
+{488,0,1,0,2,4,1,"MH6J",7,20,600,"News Chopper"},
+{511,2,1,0,1,2,2,"An-2 Biplane",7,100,400,"Beagle"},
+
+-- BOATS
+{453,0,1,0,1,2,0,"Fishing Boat",4,400,100,"Reefer"},
+{595,0,1,0,1,2,0,"Small Boat",3,0,100,"Launch"},
+{473,0,1,0,1,1,0,"PBX",2,0,100,"Dinghy"},
+}
+
+variablesConversionTable = {
+-- {"gameplayVariablesKeyName","FriendlyName","Description",defaultValue,"OriginConfig","AllowedValues"}
+{"adbantime","Bantime for Ads","If noadvert is set to true, defines how long the ban should last in seconds",86400,"Shared","Numbers"},
+{"alice_gunslots","Experimental","Not in use",1,"Server","Numbers"},
+{"alice_slots","ALICE Pack Slots","Inventory Slots for ALICE Pack",16,"Server","Numbers"},
+{"ambiencesoundvolume","Ambience Sound Volume","How loud ambience sounds should be, set to 0 to disable, max is 1.0",0.8,"Client","Numbers"},
+{"amountzombies","Amount of Zombies","How many zombies should spawn in total?",3,"Server","Numbers"},
+{"armachat","ArmA II Chatbox","Enables/disables ArmA II Chatbox",false,"Client","true/false"},
+{"assaultpack_gunslots","Experimental","Not in use",1,"Server","Numbers"},
+{"assaultpack_slots","Assault Pack Slots","Inventory Slots for Assault Pack",12,"Server","Numbers"},
+{"backupenabled","Enable Backup","Enables/Disables backup of vehicles & tents",true,"Server","true/false"},
+{"backupinterval","Backup Interval","Defines when the backup should happen",3600000,"Server","Numbers"},
+{"bantime","Ban Time","If security level is 2, for how long should the player be banned (in seconds)? 0 = Forever",0,"Shared","Numbers"},
+{"britishassault_gunslots","Experimental","Not in use",1,"Server","Numbers"},
+{"britishassault_slots","British Assault Pack Slots","Inventory Slots for British Assault Pack",18,"Server","Numbers"},
+{"combatlog","Combat Log","Enables/disables anti-combat logging",true,"Shared","true/false"},
+{"coyote_gunslots","Experimental","Not in use",2,"Server","Numbers"},
+{"coyote_slots","Coyote Backpack Slots","Inventory Slots for Coyote Backpack",24,"Server","Numbers"},
+{"customtime","Custom Time","How long should an ingame minute last in ms?",10000,"Server","Numbers"},
+{"czech_gunslots","Experimental","Not in use",6,"Server","Numbers"},
+{"czech_slots","Czech Backpack Slots","Inventory Slots for Czech Backpack",30,"Server","Numbers"},
+{"czechvest_gunslots","Experimental","Not in use",1,"Server","Numbers"},
+{"czechvest_slots","Czech Vest Slots","Inventory Slots for Czech Vest",13,"Server","Numbers"},
+{"debugmonitorenabled","Show/Hide Debug Monitor","Enables/disables the debug monitor (F5)?",false,"Client","true/false"},
+{"difficulty","Difficulty","Set difficulty: normal/veteran/hardcore","normal","Shared","normal/veteran/hardcore"},
+{"enablenight","Enable/Disable Night","Enables/disables realistic night",true,"Client","true/false"},
+{"enableprone","Enable/Disable Prone","Enables/disables proning (L)",true,"Server","true/false"},
+{"fuelEnabled","Enable/Disable Fuel","Enables/disables fuel consumption",true,"Server","true/false"},
+{"headshotdamage_player","Headshot Damage Multiplier: Player","Sets damage multiplier for players on headshot",1.5,"Client","Numbers"},
+{"headshotdamage_zombie","Headshot Damage Multiplier: Zombie","Sets damage multiplier for zombies on headshot",1.5,"Client","Numbers"},
+{"itemrespawntimer","Item Respawn Timer","Determines when loot should respawn in ms",14400000,"Server","Numbers"},
+{"loseWire","Damage: Wirefence","Damage the player should receive when hitting a wirefence",1000,"Server","Numbers"},
+{"maxPetrolFuelAmount","Max Fuel of Petrolstations","Determines amount of fuel each petrol station in the world contains","math.random(1,15)","Server","Numbers"},
+{"maxslots","Max Slots","Max amount of inventory slots possible on your server",30,"Shared","Numbers"},
+{"maxzombiesglobal","Experimental","Not in use",0,"Server","Numbers"},
+{"maxzombiesperloot","Experimental","Experimental",0,"Server","Numbers"},
+{"newzombiespawnsystem","Experimental","Experimental",0,"Server","Numbers"},
+{"noadvert","No Ads","Prevents ads in chat",true,"Shared","true/false"},
+{"packetlosskick","Packet Loss: Kick","Kicks player if packet loss is 100%",true,"Shared","true/false"},
+{"packetlossmax","Packet Loss: Max Amount","Max amount of packet loss",10,"Shared","Numbers"},
+{"painshakelevel","Pain: Shake Level","Sets level of camera shake when in pain",150,"Client","Numbers"},
+{"ping","Ping","Highest ping allowed on the server",600,"Client","Numbers"},
+{"pingkick","Ping: Kick","Kick if ping is too high",true,"Shared","true/false"},
+{"playerzombies","Player: Zombies","When should zombies spawn?",6,"Server","Numbers"},
+{"realtime","Real Time","Enables/disables real time (using server time)",false,"Server","true/false"},
+{"respawnwarning","Loot Respawn: Warning","Warns player when loot is about to respawn",true,"Server","true/false"},
+{"securitylevel","Security Level","Sets security of BattlDayZ (0 = Disabled, 1 = Kick, 2 = Ban",1,"Shared","Numbers"},
+{"silencedDMRs","Silent DMR's","Silence DMR's",true,"Server","true/false"},
+{"spawnselection","Spawn Selection","Enable/disable spawn selection upon death",false,"Server","true/false"},
+{"survival_gunslots","Survival ACU Gunslots","Not in use",1,"Server","Numbers"},
+{"survival_slots","Survival ACU Slots","Inventory Slots for Survival ACU",17,"Server","Numbers"},
+{"temperaturesprint","Temperature Up: Sprint","Amount of temperature to be gained when sprinting",0.005,"Server","Numbers"},
+{"temperaturewater","Temperature Down: Water","Amount of temperature to lose when inside water",-0.1,"Server","Numbers"},
+{"waterdamage","Drowning Damage","Damage when player is drowning","math.random(5500,7100)","Client","Numbers"},
+{"weight_food","Experimental","Not in use",0,"Server","Numbers"},
+{"weight_loose","Experimental","Not in use",0,"Server","Numbers"},
+{"weight_loosetimer","Experimental","Not in use",0,"Server","Numbers"},
+{"weight_thirst","Experimental","Not in use",0,"Server","Numbers"},
+{"zombieblood","Zombie Blood","Amount of blood for zombies",4500,"Server","Numbers"},
+{"zombiedamage","Zombie Damage","Amount of damage a zombie deals to a player",650,"Client","Numbers"},
+{"zombiespawnradius","Experimental","Experimental",20,"Server","Numbers"},
+}
+
+gameplayVariablesTableC = {}
+gameplayVariablesTableS = {}
diff --git a/dayzadmin/meta.xml b/dayzadmin/meta.xml
index 6d6254d..2ac4db5 100644
--- a/dayzadmin/meta.xml
+++ b/dayzadmin/meta.xml
@@ -1,5 +1,6 @@
+
diff --git a/login/dayzsoundtrack.mp3 b/login/dayzsoundtrack.mp3
index fda12d5..11adc2b 100644
Binary files a/login/dayzsoundtrack.mp3 and b/login/dayzsoundtrack.mp3 differ
diff --git a/login/images/background_1.png b/login/images/background_1.png
index 03793ae..be4fb15 100644
Binary files a/login/images/background_1.png and b/login/images/background_1.png differ
diff --git a/login/images/background_2.png b/login/images/background_2.png
index 01c30de..b7f5bec 100644
Binary files a/login/images/background_2.png and b/login/images/background_2.png differ
diff --git a/login/images/background_3.png b/login/images/background_3.png
index 618a5e0..91aea82 100644
Binary files a/login/images/background_3.png and b/login/images/background_3.png differ
diff --git a/login/images/background_4.png b/login/images/background_4.png
index aefe85b..0c67314 100644
Binary files a/login/images/background_4.png and b/login/images/background_4.png differ
diff --git a/login/images/background_5.png b/login/images/background_5.png
index 00b4536..f73ac26 100644
Binary files a/login/images/background_5.png and b/login/images/background_5.png differ
diff --git a/login/login_client.lua b/login/login_client.lua
index 60b7e30..2e97270 100644
--- a/login/login_client.lua
+++ b/login/login_client.lua
@@ -128,10 +128,10 @@ function showLogin()
guiLabelSetHorizontalAlign(background_news_text,"left",true)
guiLabelSetHorizontalAlign(background_news_label,"center",true)
guiLabelSetHorizontalAlign(background_contributors_contri,"center",true)
- guiRadioButtonSetSelected(Login_Edit[5],true)
+ --guiRadioButtonSetSelected(Login_Edit[5],true)
guiEditSetMasked(Login_Edit[2],true)
guiEditSetMasked(Login_Edit[4],true)
- if number == 2 or number == 4 or number == 5 then
+ if number == 2 or number == 5 then
guiLabelSetColor(title_label,0,0,0)
guiLabelSetColor(version_label,0,0,0)
else
@@ -308,4 +308,4 @@ function dayR( )
dxDrawText( "MTA DayZ", ( 40 / sourceX ) * sx, ( 850 / sourceY ) * sy, ( 187 / sourceX ) * sx, ( 324 / sourceY ) * sy, tocolor(0, 0, 0, 150), 2.00, ft, "left", "top", false, false, true, false, false )
end
end
-addEventHandler ( "onClientRender", root, dayR)
\ No newline at end of file
+--addEventHandler ( "onClientRender", root, dayR)
\ No newline at end of file
diff --git a/login/login_server.lua b/login/login_server.lua
index 70efb6c..cf26f9d 100644
--- a/login/login_server.lua
+++ b/login/login_server.lua
@@ -17,23 +17,71 @@ function tryToLoginPlayer (username, password)
return false
end
end
+
--Proceed with logging in...
- local account = getAccount(username, password)
- if not account then
- reason = "Account does not exist"
- triggerClientEvent("onErrorOutputReason",source,reason)
- return
- elseif account then
- local accountName = getAccountName(account)
- logIn(source, account, password)
- triggerClientEvent(source,"onPlayerDoneLogin", source, accountName, password)
- triggerEvent("onPlayerDayZLogin", getRootElement(),username,pass,source)
- local theTime = getRealTime()
- local hour = theTime.hour
- local minute = theTime.minute
- local seconds = theTime.second
- local theAccount = getPlayerAccount(client)
- exports.DayZ:saveLog("["..hour..":"..minute..":"..seconds.."] [LOGIN] "..username.." has logged in. Player: "..getPlayerName(client).."\n","accounts")
+
+ if exports["DayZ"].getGameplayVariablesServerPairs()["MySQL"] then
+ local dbConnection = dbConnect( "mysql", "dbname="..exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_DB"]..";host="..exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_host"]..";port="..exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_port"], exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_user"], exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_pass"], "share=1" )
+ dbExec(dbConnection,"CREATE TABLE IF NOT EXISTS `accounts` (`ID` int(11) NOT NULL AUTO_INCREMENT,`username` text NOT NULL,`password` text NOT NULL,`userdata` text NOT NULL, `rank` text NOT NULL, `creationDate` text NOT NULL,`lastLogin` text NOT NULL, PRIMARY KEY (`ID`))")
+ local qh = dbQuery(dbConnection, "SELECT * FROM accounts WHERE `username`=? AND `password`=? LIMIT 1",username,md5(password))
+ local result = dbPoll(qh, -1)
+ if #result > 0 then
+ if getPlayerAccount(client) then
+ logOut(client)
+ end
+ local cc = getAccount(username) -- Why we're still using internal DB with MySQL? That's the solution to avoid script bugs (scripts that still uses ACL or something)
+ if cc then
+ if getAccount(username, password) then
+ logIn(source, cc, password)
+ else
+ if delAccount(cc) then
+ cc = addAccount(username, password)
+ if not logIn(source, cc, password) then
+ reason = "Unknown error"
+ triggerClientEvent("onErrorOutputReason",source,reason)
+ return
+ end
+ end
+ end
+ else
+ cc = addAccount(username, password)
+ if not logIn(source, cc, password) then
+ reason = "Unknown error"
+ triggerClientEvent("onErrorOutputReason",source,reason)
+ return
+ end
+ end
+ triggerClientEvent(source,"onPlayerDoneLogin", source, username, password)
+ triggerEvent("onPlayerDayZLogin", getRootElement(), username, password, source)
+ local theTime = getRealTime()
+ local hour = theTime.hour
+ local minute = theTime.minute
+ local seconds = theTime.second
+ local theAccount = getPlayerAccount(client)
+ exports.DayZ:saveLog("["..hour..":"..minute..":"..seconds.."] [LOGIN] "..username.." has logged in. Player: "..getPlayerName(client).."\n","accounts")
+ else
+ reason = "Account does not exist"
+ triggerClientEvent("onErrorOutputReason",source,reason)
+ return
+ end
+ else
+ local account = getAccount(username, password)
+ if not account then
+ reason = "Account does not exist"
+ triggerClientEvent("onErrorOutputReason",source,reason)
+ return
+ elseif account then
+ local accountName = getAccountName(account)
+ logIn(source, account, password)
+ triggerClientEvent(source,"onPlayerDoneLogin", source, accountName, password)
+ triggerEvent("onPlayerDayZLogin", getRootElement(),username,password,source)
+ local theTime = getRealTime()
+ local hour = theTime.hour
+ local minute = theTime.minute
+ local seconds = theTime.second
+ local theAccount = getPlayerAccount(client)
+ exports.DayZ:saveLog("["..hour..":"..minute..":"..seconds.."] [LOGIN] "..username.." has logged in. Player: "..getPlayerName(client).."\n","accounts")
+ end
end
end
addEvent("onClientSendLoginDataToServer", true)
@@ -49,28 +97,73 @@ function tryToRegsiterPlayer(username, pass)
return
end
end
- if not getAccount(username) then
- theAccount = addAccount(username, pass)
- if (theAccount) then
- logIn(source, theAccount, pass)
- outputChatBox("You successfully registered account '" ..username.. "' for player '" ..getPlayerName(source).. "'#FFFFFF with password '" ..pass.."'!", source, 255, 255, 255, true)
- triggerClientEvent(source,"onPlayerDoneLogin", source,username,pass)
- triggerEvent("onPlayerDayZRegister", getRootElement(),username,pass,source)
- triggerEvent("onPlayerDayZLogin", getRootElement(),username,pass,source)
+ if exports["DayZ"].getGameplayVariablesServerPairs()["MySQL"] then
+ local dbConnection = dbConnect( "mysql", "dbname="..exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_DB"]..";host="..exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_host"]..";port="..exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_port"], exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_user"], exports["DayZ"].getGameplayVariablesServerPairs()["MySQL_pass"], "share=1" )
+ dbExec(dbConnection,"CREATE TABLE IF NOT EXISTS `accounts` (`ID` int(11) NOT NULL AUTO_INCREMENT,`username` text NOT NULL,`password` text NOT NULL,`userdata` text NOT NULL, `rank` text NOT NULL, `creationDate` text NOT NULL,`lastLogin` text NOT NULL, PRIMARY KEY (`ID`))") local qh = dbQuery(dbConnection, "SELECT * FROM accounts WHERE `username`=? LIMIT 1",username)
+ local result = dbPoll(qh, -1)
+ if #result == 0 then
local theTime = getRealTime()
local hour = theTime.hour
local minute = theTime.minute
local seconds = theTime.second
- local theAccount = getPlayerAccount(client)
- exports.DayZ:saveLog("["..hour..":"..minute..":"..seconds.."] [REGISTER]: "..username.." registered this account. Initial player: "..getPlayerName(client).."\n","accounts")
- return true
+ local currentTime = theTime.monthday.."/"..(theTime.month+1).."/"..(theTime.year+1900)
+ local exec = dbExec(dbConnection, "INSERT INTO accounts VALUES (?,?,?,?,?,?,?)", nil, username, md5(pass), toJSON({}), "Survivor", currentTime, currentTime)
+ if exec then
+ local cc = getAccount(username) -- Why we're still using internal DB with MySQL? That's the solution to avoid script bugs (scripts that still uses ACL or something)
+ if cc then
+ if getAccount(username,pass) then
+ logIn(source, cc, pass)
+ else
+ if delAccount(cc) then
+ cc = addAccount(username,pass)
+ if not logIn(source, cc, pass) then
+ reason = "Unknown error"
+ triggerClientEvent("onErrorOutputReason",source,reason)
+ return
+ end
+ end
+ end
+ else
+ cc = addAccount(username,pass)
+ if not logIn(source, cc, pass) then
+ reason = "Unknown error"
+ triggerClientEvent("onErrorOutputReason",source,reason)
+ return
+ end
+ end
+ outputChatBox("You successfully registered account '" ..username.. "' for player '" ..getPlayerName(source).. "'#FFFFFF with password '" ..pass.."'!", source, 255, 255, 255, true)
+ triggerClientEvent(source,"onPlayerDoneLogin", source,username,pass)
+ triggerEvent("onPlayerDayZRegister", getRootElement(),username,pass,source)
+ --triggerEvent("onPlayerDayZLogin", getRootElement(),username,pass,source)
+ exports.DayZ:saveLog("["..currentTime.." - "..hour..":"..minute..":"..seconds.."] [REGISTER]: "..username.." registered this account. Initial player: "..getPlayerName(client).."\n","accounts")
+ return true
+ else
+ reason = "Was unable to add account"
+ end
else
- reason = "Was unable to add account"
- return
+ reason = "Account already exists"
end
else
- reason = "Account already exists"
- return
+ if not getAccount(username) then
+ theAccount = addAccount(username, pass)
+ if (theAccount) then
+ logIn(source, theAccount, pass)
+ outputChatBox("You successfully registered account '" ..username.. "' for player '" ..getPlayerName(source).. "'#FFFFFF with password '" ..pass.."'!", source, 255, 255, 255, true)
+ triggerClientEvent(source,"onPlayerDoneLogin", source,username,pass)
+ triggerEvent("onPlayerDayZRegister", getRootElement(),username,pass,source)
+ --triggerEvent("onPlayerDayZLogin", getRootElement(),username,pass,source)
+ local theTime = getRealTime()
+ local hour = theTime.hour
+ local minute = theTime.minute
+ local seconds = theTime.second
+ exports.DayZ:saveLog("["..hour..":"..minute..":"..seconds.."] [REGISTER]: "..username.." registered this account. Initial player: "..getPlayerName(client).."\n","accounts")
+ return true
+ else
+ reason = "Was unable to add account"
+ end
+ else
+ reason = "Account already exists"
+ end
end
triggerClientEvent("onErrorOutputReason",source,reason)
@@ -82,7 +175,7 @@ addEventHandler("onClientSendRegisterDataToServer", getRootElement(), tryToRegsi
function pullChangelog(news)
local player = client -- idk how to send it correctly to function()
if news then
- fetchRemote("https://raw.githubusercontent.com/ciber96/mtadayz/master/changelog.txt",function(data,err)
+ fetchRemote("https://raw.githubusercontent.com/ciber96/mtadayz/master/news.txt",function(data,err)
triggerClientEvent(player,"loadAPIData",player,"changelog",data)
end)
end
diff --git a/news.txt b/news.txt
new file mode 100644
index 0000000..bcd1bb6
--- /dev/null
+++ b/news.txt
@@ -0,0 +1,50 @@
+[0.9.9a] - 2017-04-28
+ADDED: New Sound + Visibility System (based on terrain, weather, light, movement)
+ADDED: New zombie spawn system based on loot location
+ADDED: Petrol stations now have a limited amount of fuel (configurable in cfgServer.lua)
+ADDED: Achievement System
+ADDED: Anti-Advertising for chat system
+ADDED: Indicators for temperature rising/falling
+ADDED: Occasional rain when weather is cloudy
+ADDED: MySQL implementation
+ADDED: Old clothes/skin system
+ADDED: New condition (fractured arms)
+ADDED: Vehicle respawn command
+ADDED: Setting for camera sway when in pain
+ADDED: Helmets for headshots
+ADDED: [DayZAdmin] Ability to change gameplayVariables ingame
+ADDED: Binds for GPS (Key: 7) and Compass (Key: 8)
+ADDED: Spawn Selection System
+ADDED: Randomized loot spots
+ADDED: Random clothes on spawn if clothes system is activated
+CHANGED: Logs System refactored
+CHANGED: Simplified player spawning code
+CHANGED: Simplified vehicle spawning code (makes it easier to add new vehicles)
+CHANGED: Simplified sound code
+CHANGED: Custom chat can now be toggled on/off (/chat)
+CHANGED: Eased lag a bit
+CHANGED: Updated how Helicrashes and hospital bags were being initialised
+CHANGED: Version rewrite, tree handling optimised
+CHANGED: Hunger & Thirst now decrease according to difficulty too
+CHANGED: Moved debug monitor to Journal (Key: 6)
+CHANGED: New damage code for players
+CHANGED: Some zombies will sprint (depends on difficulty)
+CHANGED: Kills have to be confirmed with "Check Body" (player kills only)
+CHANGED: First Person Mode (view can be rotated 360°)
+FIXED: consume_player.lua causing lots of errors
+FIXED: Bug with tree chopping
+FIXED: Hunger & Thirst not decreasing
+FIXED: Bug with setPedStat
+FIXED: Flashlight appearing on HUD with ammo count
+FIXED: Bug where player would continue to lose blood after becoming unconscious and being killed
+FIXED: Crafting getting bugged when inventory is full
+FIXED: Milk breaking inventory
+FIXED: Unconscious animation being clientside only
+FIXED: M1911 not having a firing sound
+FIXED: Old bug with damage when falling
+FIXED: Floating medical box in Fort Carson
+FIXED: Constant raining
+FIXED: Hunger and Thirst not really decreasing
+FIXED: M24 not having any sound
+REMOVED: Viral zombies (until a better solution is found for more dangerous zombies)
+REMOVED: Housing mod
\ No newline at end of file
diff --git a/slothbot/sbclient.lua b/slothbot/sbclient.lua
index 0c70e94..d3a3f15 100644
--- a/slothbot/sbclient.lua
+++ b/slothbot/sbclient.lua
@@ -1324,3 +1324,9 @@ function resourcestart()
end
end
addEventHandler( "onClientResourceStart", resourceRoot, resourcestart )
+
+function setBotSprintingMode(ped)
+ setPedControlState(ped,"sprint",true)
+end
+addEvent("setBotSprintingMode",true)
+addEventHandler("setBotSprintingMode",root,setBotSprintingMode)
diff --git a/slothbot/sbserver.lua b/slothbot/sbserver.lua
index 9337a78..30fd8e7 100644
--- a/slothbot/sbserver.lua
+++ b/slothbot/sbserver.lua
@@ -1118,7 +1118,7 @@ function setBotGuard (theped, x, y, z, priority)
end
end
-function spawnBot(x, y, z, rot, skin, interior, dimension, team, weapon, mode, modesubject)
+function spawnBot(x, y, z, rot, skin, interior, dimension, team, weapon, mode, modesubject, speedLevel)
--checks the function commands to see if all neccesary parts are filled, sets defaults if not or returns false.
if not x then return false end
if not y then return false end
@@ -1131,6 +1131,7 @@ function spawnBot(x, y, z, rot, skin, interior, dimension, team, weapon, mode, m
if not weapon then weapon = 0 end
if not mode then mode = "hunting" end
if not modesubject then modesubject = nil end
+ if not speedLevel then speedLevel = "sprint" end
if mode == "following" then
if not modesubject then return false end
end
@@ -1165,6 +1166,9 @@ function spawnBot(x, y, z, rot, skin, interior, dimension, team, weapon, mode, m
else
setTimer ( setElementData, 600, 1, slothbot, "status", "hunting")
end
+ if speedLevel == "sprint" then
+ triggerClientEvent("setBotSprintingMode",root,slothbot)
+ end
return slothbot
end
end