Jump to content

Ola Boa Noite, Estou precisando de uma ajuda no meu Servidor DayZ


Recommended Posts

Então o "bug" e que quando um carro explode perto do jogador, o player não recebe dano, no debugscript 3 fala que o erro e na linha 1116 do codigo que irei colocar abaixo.

addEventHandler("onClientPlayerDamage",getLocalPlayer(),function(attacker,weapon,bodypart,loss)
  if not getElementData(getLocalPlayer(),"vestLife") or not getElementData(getLocalPlayer(),"helmetLife") then
    setElementData(getLocalPlayer(),"vestLife",50)
    setElementData(getLocalPlayer(),"helmetLife",100)
  end
  if weapon and weapon > 1 and attacker and getElementType(attacker)== "player" then
    damage = getWeaponDamage(weapon,attacker) / 100
    if bodypart == 9 then
      if getActiveHelmetVar(getLocalPlayer()) then
        helmetLife = getElementData(getLocalPlayer(),"helmetLife")
        setElementData(getLocalPlayer(),"helmetLife", helmetLife -damage)
        if getElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer())) >= 1 then
          setElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer()),getElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer())) - 1)
        end
        if getElementData(getLocalPlayer(),"helmetLife") <= 0 then
          setElementData(getLocalPlayer(),"helmetLife",100)
          setElementData(getLocalPlayer(),getActiveHelmetVar(getLocalPlayer()),false)
        end
      end
    end
  end
end)

addEventHandler("onClientPlayerDamage",getLocalPlayer(),function(attacker,weapon,bodypart,loss)
  if not getElementData(getLocalPlayer(),"vestLife") or not getElementData(getLocalPlayer(),"vestLife") then
    setElementData(getLocalPlayer(),"vestLife",50)
    setElementData(getLocalPlayer(),"vestLife",100)
  end
  if weapon and weapon > 1 and attacker and getElementType(attacker)== "player" then
    damage = getWeaponDamage(weapon,attacker) / 100
    if bodypart == 3 then
      if getActiveHelmetVar(getLocalPlayer()) then
        vestLife = getElementData(getLocalPlayer(),"vestLife")
        setElementData(getLocalPlayer(),"vestLife", vestLife -damage)
        if getElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer())) >= 1 then
          setElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer()),getElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer())) - 1)
        end
        if getElementData(getLocalPlayer(),"vestLife") <= 0 then
          setElementData(getLocalPlayer(),"vestLife",100)
          setElementData(getLocalPlayer(),getActiveHelmetVar(getLocalPlayer()),false)
        end
      end
    end
  end
end)
Edited by Lord Henry
Removida a parte duplicada em inglês.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...