Jump to content

Alguém poderia me ajudar?


Recommended Posts

Tô tentando pra colocar pro player que morrer ver quem matou ele,  peguei a função e coloquei no DxDrawText"Assasino:" só que não funcionou, alguém pode me ajudar? por favor, sou cru com programação.

 

function playerDamage_text ( attacker, loss )
     
     if not (getElementData(source, "attackerD")) then
         setElementData(source, "attackerD", "N/A")
         return
     end
         if attacker then
             if (getElementData(source, "attackerD") == getElementData(attacker, "char:name")) then
             else
             setElementData(source, "attackerD", getElementData(attacker, "char:name"))
         end
    end
end
addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text )


function contador()
    local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear")
    local minutes, seconds = convertTime(timer)
    

    if minutes < 10 then
        minutes = "0"..minutes
    end
    if seconds < 10 then
        seconds = "0"..seconds
    end
        dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false)
        dxDrawText("IMPOSE EMERGÊNCIA", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("Você está ferido e precisa de um médico", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Chame os paramédicos no /192 e aguarde", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("TEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
        dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false)
        dxDrawText("Assasino:" "#ffffff:#ff0000"..attackerD, screenW * 0.5400, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
end

Link to comment

                                 Minha recomendação:

 server-side;

function morreu ( attacker )
	if ( attacker ) then
	 triggerClientEvent ( source, "Morreu", source, attacker )
    end
end
addEventHandler ( "onPlayerWasted", getRootElement(), morreu )

client-side;

 

function contador(attacker)
    local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear")
    local minutes, seconds = convertTime(timer)
    

    if minutes < 10 then
        minutes = "0"..minutes
    end
    if seconds < 10 then
        seconds = "0"..seconds
    end
        dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false)
        dxDrawText("IMPOSE EMERGÊNCIA", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("Você está ferido e precisa de um médico", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Chame os paramédicos no /192 e aguarde", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("TEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
        dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false)
        dxDrawText("Assasino:" "#ffffff:#ff0000"..attacker, screenW * 0.5400, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
end
addEvent("Morreu",true)
addEventHandler("Morreu", getRootElement(), contador)

 

Bom, não testei; Mas tente assim meu querido!

  • Like 1
Link to comment
On 11/05/2020 at 10:43, ~#BlackSCR said:

                                 Minha recomendação:

 server-side;


function morreu ( attacker )
	if ( attacker ) then
	 triggerClientEvent ( source, "Morreu", source, attacker )
    end
end
addEventHandler ( "onPlayerWasted", getRootElement(), morreu )

client-side;

 


function contador(attacker)
    local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear")
    local minutes, seconds = convertTime(timer)
    

    if minutes < 10 then
        minutes = "0"..minutes
    end
    if seconds < 10 then
        seconds = "0"..seconds
    end
        dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false)
        dxDrawText("IMPOSE EMERGÊNCIA", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("Você está ferido e precisa de um médico", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Chame os paramédicos no /192 e aguarde", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("TEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
        dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false)
        dxDrawText("Assasino:" "#ffffff:#ff0000"..attacker, screenW * 0.5400, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
end
addEvent("Morreu",true)
addEventHandler("Morreu", getRootElement(), contador)

 

Bom, não testei; Mas tente assim meu querido!

Irie testar, muito obrigado.

Link to comment

Olá, boa noite.

Eu estou tentando colocar pra quando o player for caido, por outro player, aparecer o id de quem matou.

Imagem do erro pelo "debugscript 3" : http://prntscr.com/sge9m3

Client:

 

function playerDamage_text ( attacker, loss )
	 
	 if not (getElementData(source, "attackerD")) then
	     setElementData(source, "attackerD", "N/A")
	     return
	 end
	     if attacker then
             if (getElementData(source, "attackerD") == getElementData(attacker, "char:name")) then
		     else
		     setElementData(source, "attackerD", getElementData(attacker, "char:name"))
		 end
	end
end
addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text )


function contador()
	local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear")
    local minutes, seconds = convertTime(timer)

    if minutes < 10 then
        minutes = "0"..minutes
    end
    if seconds < 10 then
        seconds = "0"..seconds
    end
        dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false)
        dxDrawText("SISTEMA EMERGÊNCIA IMPOSE", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("Você está ferido e precisa de um médico", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Chame os paramédicos no /192 e aguarde", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("TEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
        dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false)
        dxDrawText("Assasino:"..attackerD, screenW * 0.5400, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
end

 

Edited by [email protected]
Link to comment
function playerDamage_text ( attacker, loss )
	 
	 if not (getElementData(source, "attackerD")) then
	     setElementData(source, "attackerD", "N/A")
	     return
	 end
	     if attacker then
             if (getElementData(source, "attackerD") == getElementData(attacker, "char:name")) then
		     else
		     setElementData(source, "attackerD", getElementData(attacker, "char:name"))
		 end
	end
end
addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text )


function contador()
    local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear")
    local minutes, seconds = convertTime(timer)
    local attackerD = "Desconhecido"
    if getElementData(localPlayer, "attackerD") then
    	attackerD = getElementData(localPlayer, "attackerD")
    end

    if minutes < 10 then
        minutes = "0"..minutes
    end
    if seconds < 10 then
        seconds = "0"..seconds
    end
        dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false)
        dxDrawText("SISTEMA EMERGÊNCIA IMPOSE", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("Você está ferido e precisa de um médico", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Chame os paramédicos no /192 e aguarde", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("TEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
        dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false)
        dxDrawText("Assasino:"..attackerD, screenW * 0.5400, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
end

 

  • Like 1
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...