Jump to content

Help spawn death


Recommended Posts

 

I need a help in a Spwan script when it is born .. I am trying to make a system that appears the nick of the player that killed, only case died alone does not appear Look at the script below Please do not know where to errando .. script works only That when the player kills does not appear his nickname only appears that he died

Spoiler

function showDayZDeathScreen(ammo, attacker, weapon, bodypart)
  local x,y,z = getElementPosition(source)
  fadeCamera(true,5)
  setCameraMatrix (x,y,z, 0,0,5000)
  deadBackground = guiCreateStaticImage(0,0,1,1,"images/dead.png",true)
  playSound("sounds/panic_0.ogg")
  deadText = guiCreateLabel(0,0,1,0.2,"Aguarde...",true,deadBackground)
  guiLabelSetHorizontalAlign(deadText, "center", false)
  guiLabelSetVerticalAlign(deadText, "center")
  setTimer(function()
    setTimer(function()
      if (attacker) then
        local tempString
        if (getElementType (attacker) == "player" ) then
            tempString = "Wait ...\nYou will be reborn in 10 seconds.\n\nYou died in "..getPlayerName( source ).." ("..getWeaponNameFromID ( weapon )..")"
        elseif ( getElementType ( attacker ) == "vehicle" ) then
            tempString = "Wait ...\nYou will be reborn in 10 seconds.\n\nYou died in the vehicle."
        end
        text = tempString

else
        text = "Wait...\nYou will be reborn in 10 Seconds.\n You died."

    end
      guiSetText(deadText, text)
      if number < 1 then
        guiSetVisible(deadBackground,false)
        if isElement(deadBackground) then
          destroyElement(deadBackground)
        end
      end
    end, 1000, 7)
  end,2500,1)
end
addEvent("onClientPlayerDeathInfo",true)
addEventHandler("onClientPlayerDeathInfo",getRootElement(),showDayZDeathScreen)

 

 

I need to know where I'm wrong and how to fix this I'm waiting for an answer .. I've been trying to get this all day

By:

~Baido

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...