.
["Items"] = {
{"Antidot",1,"Use"},
if itemName == "Bandage" then
if getElementData(getLocalPlayer(),"bleeding") == 0 then
return
end
end
if itemName == "Antidot" then
if not getElementData(getLocalPlayer(), "infection") then
return
end
end
{"Watch"},
{"Antidot"},
{"Watch"},
{"Antidot"},
if itemName == "Bandage" then
setElementData(playersource,"bleeding",0)
setElementData(playersource,itemName,getElementData(playersource,itemName)-1)
elseif itemName == "Antidot" then
addPlayerStats (playersource,"blood",269)
setElementData(playersource,"bleeding",0)
setElementData(playersource,"infection",false)
setElementData(playersource,itemName,getElementData(playersource,itemName)-1)
if getElementData(attacker,"zombie") then
setElementData(getLocalPlayer(),"blood",getElementData(getLocalPlayer(),"blood")-gameplayVariables["zombiedamage"]) -- Damage output - Default: 400,900
local number = math.random(1,7)
if number == 4 then
setElementData(getLocalPlayer(),"bleeding",getElementData(getLocalPlayer(),"bleeding") + math.floor(loss*10))
end
end
if getElementData(attacker, "zombie") then
setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - gameplayVariables.zombiedamage)
--[[local aleatory = math.random(1,
if aleatory == 4 then
setElementData(getLocalPlayer(), "infection", true)
end]]
local number = math.random(1,20)
if number == 6 then
setElementData(getLocalPlayer(),"infection",true)
end
local number = math.random(1, 7)
if number == 4 then
setElementData(getLocalPlayer(), "bleeding", getElementData(getLocalPlayer(), "bleeding") + math.floor(loss * 10))
end
end
function createBloodForBleedingPlayers ()
if getElementData(getLocalPlayer(),"logedin") then
local x,y,z = getElementPosition(getLocalPlayer())
for i,player in ipairs(getElementsByType("player")) do
local bleeding = getElementData(player,"bleeding") or 0
if bleeding > 0 then
local px,py,pz = getPedBonePosition (player,3)
local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )
if bleeding > 600 then
number = 5
elseif bleeding > 300 then
number = 3
elseif bleeding > 100 then
number = 1
else
number = 0
end
if pdistance <= 120 then
fxAddBlood ( px,py,pz,0,0,0,number, 1 )
end
end
end
end
end
setTimer(createBloodForBleedingPlayers,300,0)
function checkAnt()
if getElementData(getLocalPlayer(), "infection") then
setElementData(getLocalPlayer(),"bleeding",325)
end
end
setTimer(checkAnt, 5000, 0)
--brokenbone
if getElementData(getLocalPlayer(),"brokenbone") then
dxDrawImage ( screenWidth*0.9375 , screenHeight*0.55, screenHeight*0.065, screenHeight*0.065, "images/dayzicons/brokenbone.png",0,0,0,tocolor(255,255,255))
end
--INFECTION
if getElementData(getLocalPlayer(), "infection") then
setTimer(function()
local sound = playSound("sounds/cough.ogg") --Play wasted.mp3 from the sounds folder
setSoundVolume(sound, 1.2)
destroyElement(sound)
end,1000, 1)
dxDrawImage ( screenWidth*0.94 , screenHeight*0.85, screenHeight*0.065, screenHeight*0.065, "images/dayzicons/infection.png",0,0,0,tocolor(255,255,255,fading))
end
playerTarget = false
function targetingActivated ( target )
if ( target ) and getElementType(target) == "player" then
playerTarget = target
else
playerTarget = false
end
end
addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated )
function infection(source)
if getElementData(getLocalPlayer(), "logedin") then
if getElementData(getLocalPlayer(), "infection") then
local player = getLocalPlayer()
local sound = playSound("sounds/cough.mp3")
setSoundVolume(sound, 1.2)
--local amin = setPedAnimation(getLocalPlayer(), "FOOD", "EAT_Vomit_P", 8000, false, false, nil, false)
setTimer(function()
destroyElement(sound)
destroyElement(1000)
end,1000, 1)
end
end
end
setTimer (infection,10000, 0)
<file src="sounds/cough.ogg" />
<file src="items/antidot.txd" />
<file src="items/antidot.dff" />
<file src="images/dayzicons/infection.png" />
["hospital"] = {
{"Antidot",3781,2.1,0},
weaponTXD = engineLoadTXD ("items/camera.txd");
engineImportTXD (weaponTXD, 367);
weaponDFF = engineLoadDFF ("items/camera.dff", 367);
engineReplaceModel (weaponDFF, 367);
itemTXD = engineLoadTXD ("items/antidot.txd");
engineImportTXD (itemTXD, 3781);
itemDFF = engineLoadDFF ("items/antidot.dff", 3781);
engineReplaceModel (itemDFF, 3781);