Criar um Site Grátis Fantástico
Translate to English Translate to Spanish Translate to French Translate to German Translate to Italian Translate to Russian Translate to Chinese Translate to Japanese

Rating: 2.2/5 (73 votos)

ONLINE
1





Partilhe esta Página



Total de visitas: 10998
Tutorial adicionar sistema de infecção.
Tutorial adicionar sistema de infecção.

.

Abra o inventory.lua
Procure por:
Código:
 ["Items"] = {
Abaixo coloque: 
Código:
{"Antidot",1,"Use"},

Procure por: 
Código:
      if itemName == "Bandage" then
         if getElementData(getLocalPlayer(),"bleeding") == 0 then
            return
         end
      end   

Abaixo coloque:
Código:
      if itemName == "Antidot" then
         if not getElementData(getLocalPlayer(), "infection") then
            return
         end
      end   


Abra o login.lua
Procure por:
Código:
{"Watch"},
Abaixo coloque:
Código:
{"Antidot"},
Fassa isso 2 vezes no login e no spawn.lua !

Abra o survivorSystem.lua
Procure por:
Código:
{"Watch"},
Abaixo coloque:
Código:
{"Antidot"},

Procure por:
Código:
    if itemName == "Bandage" then
        setElementData(playersource,"bleeding",0)
        setElementData(playersource,itemName,getElementData(playersource,itemName)-1)

Abaixo coloque: 
Código:
    elseif itemName == "Antidot" then
        addPlayerStats (playersource,"blood",269)
        setElementData(playersource,"bleeding",0)
        setElementData(playersource,"infection",false)
        setElementData(playersource,itemName,getElementData(playersource,itemName)-1)

Abra o survivorSystem_client.lua
Procure por: 
Código:
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

Troque o codigo inteiro por: 
Código:
  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

Procure por: 
Código:
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)


Abaixo coloque: 
Código:
function checkAnt()
    if getElementData(getLocalPlayer(), "infection") then
    setElementData(getLocalPlayer(),"bleeding",325)
    end
end
setTimer(checkAnt, 5000, 0)


Procure por: 
Código:
   --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


Abaixo coloque: 
Código:
    --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

Procure por: 
Código:
playerTarget = false
function targetingActivated ( target )
    if ( target ) and getElementType(target) == "player" then
        playerTarget = target
    else
        playerTarget = false
    end
end
addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated )

Abaixo coloque: 
Código:
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)


Adicione ao meta: 
Código:
    <file src="sounds/cough.ogg" />
    <file src="items/antidot.txd" />
    <file src="items/antidot.dff" />
    <file src="images/dayzicons/infection.png" />

@Edit:
Adicione no vehicle_spawn.lua
Procure por: 
Código:
["hospital"] = {
Abaixo coloque: 
Código:
{"Antidot",3781,2.1,0},

@Edit2: 
Abra o survivorSystem_client.lua
Procure por: 
Código:
weaponTXD = engineLoadTXD ("items/camera.txd");
engineImportTXD (weaponTXD, 367);
weaponDFF = engineLoadDFF ("items/camera.dff", 367);
engineReplaceModel (weaponDFF, 367);

Abaixo coloque: 
Código:
itemTXD = engineLoadTXD ("items/antidot.txd");
engineImportTXD (itemTXD, 3781);
itemDFF = engineLoadDFF ("items/antidot.dff", 3781);
engineReplaceModel (itemDFF, 3781);

Link do item,imagem e som: Clique aqui!

_____________

___________________________________________________________________________________
Correçao by: #DarkLife
Álgums correçoes Para Quem Nao Conseguir Instalar!!

codico:

no lugar de:


cidico:



é :

codico:

Adicionar na pickps 

codico:

Se nao o Item nao ira dropar!

e na meta.xml é:

codico:

obs: sem os *

e aki :

codico:

o certo é :

codico:

para trocar o diretorio da imagen o certo é :

codico: