Tutorial de como Adicionar o Sistema de Máscaras
Vá na sua DayZ e abra o Inventory.lua
Procure por:
["Items"] = {
E Adicione: {
{"Mascara",1,"Usar"},
Agora procure por:
if itemName == "Blood Bag" then
return
end
E em baixo Adicione:
if itemName == "Mascara" and getElementData ( localPlayer, "helmetOn" ) then
itemInfo = "Remover"
end
Procure por:
function playerUseItem(itemName,itemInfo)
E em baixo Adicione:
elseif itemInfo == "Mascara" then
setElementData ( localPlayer, "helmetOn", true )
elseif itemInfo == "Remover" then
setElementData ( localPlayer, "helmetOn", false )
Salve e Abra o Login.lua
Procure por:
local playerDataTable = {
E em baixo Adicione:
{"Mascara"},
Salve e Abra o Pickups.lua
Procure por:
["military"] = {
E em baixo Adicione:
{"Mascara",902,1,0,0.3},
Procure por:
["other"] = {
E em baixo Adicione:
{"Mascara",902,1,0,0.3},
Salve e Abra o Spawn.lua
Procure por:
local playerDataTable = {
E em baixo Adicione:
{"Mascara"},
Procure por:
local vehicleDataTable = {
E em baixo Adicione:
{"Mascara"},
Salve e Abra o SurvivorSystem.lua
Procure por:
local vehicleDataTableForTent = {
E em baixo Adicione:
{"Mascara"},
Procure por:
local elementBackpack = {}
function backPackBack (dataName,oldValue)
if getElementType(source) == "player" and dataName =="MAX_Slots" then
local newValue = getElementData(source,dataName)
if elementBackpack[source] then
detachElementFromBone(elementBackpack[source])
destroyElement(elementBackpack[source])
elementBackpack[source] = false
end
local x,y,z = getElementPosition(source)
local rx,ry,rz = getElementRotation(source)
if newValue == 12 then
elementBackpack[source] = createObject(3026,x,y,z)
elseif newValue == 16 then
elementBackpack[source] = createObject(1248,x,y,z)
elseif newValue == 26 then
elementBackpack[source] = createObject(1575,x,y,z)
elseif newValue == 36 then
elementBackpack[source] = createObject(1252,x,y,z)
elseif newValue == 52 then
elementBackpack[source] = createObject(2405,x,y,z)
elseif newValue == 8 then
return
end
if newValue == 26 then
attachElementToBone(elementBackpack[source],source,3,0,-0.16,0.05,270,0,180)
else
attachElementToBone(elementBackpack[source],source,3,0,-0.225,0.05,90,0,0)
end
end
if getElementType(source) == "player" and dataName == "helmetOn" then
if getElementData ( source, dataName ) then
local x, y, z = getElementPosition(source)
local helmet = createObject(902, x, y, z)
setElementData ( source, "helmetObject", helmet )
local skin = getElementModel ( source )
if skin == 16 then
attachElementToBone(helmet, source, 1, 0, 0.02, -0.53, 0, 0, 90)
elseif skin == 287 then
attachElementToBone(helmet, source, 1, 0, 0.01, -0.56, 0, 0, 90)
elseif skin == 18 then
attachElementToBone(helmet, source, 1, 0.015, 0.025, -0.54, 0, 0, 90)
elseif skin == 23 then
attachElementToBone(helmet, source, 1, 0, 0.015, -0.574, 0, 0, 90)
elseif skin == 24 then
attachElementToBone(helmet, source, 1, 0, 0.015, -0.575, 0, 0, 90)
elseif skin == 1 then
attachElementToBone(helmet, source, 1, 0, 0.015, -0.545, 0, 0, 90)
elseif skin == 2 then
attachElementToBone(helmet, source, 1, 0.015, 0.025, -0.59, 0, 0, 90)
else
attachElementToBone(helmet, source, 1, 0, 0.015, -115, 0, 0, 90)
end
else
if isElement ( getElementData ( source, "helmetObject" ) ) then
detachElementFromBone( getElementData ( source, "helmetObject" ) )
destroyElement ( getElementData ( source, "helmetObject" ) )
setElementData ( source, "helmetObject", false )
end
end
end
end
addEventHandler ( "onElementDataChange", getRootElement(), backPackBack )
Substitua Por:
local elementBackpack = {}
function backPackBack (dataName,oldValue)
if getElementType(source) == "player" and dataName =="MAX_Slots" then
local newValue = getElementData(source,dataName)
if elementBackpack[source] then
detachElementFromBone(elementBackpack[source])
destroyElement(elementBackpack[source])
elementBackpack[source] = false
end
local x,y,z = getElementPosition(source)
local rx,ry,rz = getElementRotation(source)
if newValue == 12 then
elementBackpack[source] = createObject(3026,x,y,z)
elseif newValue == 16 then
elementBackpack[source] = createObject(1248,x,y,z)
elseif newValue == 26 then
elementBackpack[source] = createObject(1575,x,y,z)
elseif newValue == 36 then
elementBackpack[source] = createObject(1252,x,y,z)
elseif newValue == 52 then
elementBackpack[source] = createObject(2405,x,y,z)
elseif newValue == 8 then
return
end
if newValue == 26 then
attachElementToBone(elementBackpack[source],source,3,0,-0.16,0.05,270,0,180)
else
attachElementToBone(elementBackpack[source],source,3,0,-0.225,0.05,90,0,0)
end
end
if getElementType(source) == "player" and dataName == "helmetOn" then
if getElementData ( source, dataName ) then
local x, y, z = getElementPosition(source)
local helmet = createObject(902, x, y, z)
setElementData ( source, "helmetObject", helmet )
local skin = getElementModel ( source )
if skin == 16 then
attachElementToBone(helmet, source, 1, 0, 0.02, -0.53, 0, 0, 90)
elseif skin == 287 then
attachElementToBone(helmet, source, 1, 0, 0.01, -0.56, 0, 0, 90)
elseif skin == 18 then
attachElementToBone(helmet, source, 1, 0.015, 0.025, -0.54, 0, 0, 90)
elseif skin == 23 then
attachElementToBone(helmet, source, 1, 0, 0.015, -0.574, 0, 0, 90)
elseif skin == 24 then
attachElementToBone(helmet, source, 1, 0, 0.015, -0.575, 0, 0, 90)
elseif skin == 1 then
attachElementToBone(helmet, source, 1, 0, 0.015, -0.545, 0, 0, 90)
elseif skin == 2 then
attachElementToBone(helmet, source, 1, 0.015, 0.025, -0.59, 0, 0, 90)
else
attachElementToBone(helmet, source, 1, 0, 0.015, -115, 0, 0, 90)
end
else
if isElement ( getElementData ( source, "helmetObject" ) ) then
detachElementFromBone( getElementData ( source, "helmetObject" ) )
destroyElement ( getElementData ( source, "helmetObject" ) )
setElementData ( source, "helmetObject", false )
end
end
end
end
addEventHandler ( "onElementDataChange", getRootElement(), backPackBack )
Procure por:
function backpackRemoveQuit ()
E em baixo Adicione:
if getElementData ( source, "helmetObject" ) then
local helmet = getElementData ( source, "helmetObject" )
if isElement ( helmet ) then
destroyElement ( helmet )
end
end
local helmet = getElementData ( source, "helmetObject" )
if isElement ( helmet ) then
destroyElement ( helmet )
end
end
Salve e Abra novamente o Inventory.lua
Procure por:
itemName2 = itemName
if itemName == "Tire_inVehicle" then itemName2 = "Tire" end
if itemName == "Engine_inVehicle" then itemName2 = "Engine" end
if (getElementData(getLocalPlayer(),itemName2) or 0)/itemPlus < 1 then
triggerEvent ("displayClientInfo", getLocalPlayer(),"Inventory","Can't drop this!",255,22,0)
return
end
E em baixo Adicione:
if itemName == "Mascara" and getElementData ( localPlayer, "helmetOn" ) and getElementData(getLocalPlayer(),"Mascara") == 1 then
triggerEvent("displayClientInfo", getLocalPlayer(), "inventory", "Você não pode jogar! Remover o capacete!", 255, 22, 0)
return true
end
triggerEvent("displayClientInfo", getLocalPlayer(), "inventory", "Você não pode jogar! Remover o capacete!", 255, 22, 0)
return true
end
Falta Alguma coisa ?
R: As Máscaras ! HU3
Comente para apareçer o Download das Máscaras