Jump to content

Recommended Posts

Posted

Não sei quase nada de scripts

Eu quero fazer que quando um jogar matar o outro recebera 6 nives de procurado 

 

function client_kill_ped(ped, killer, body_part)
    if not ped or not isElement(ped) or isPedDead(ped) or getPedOccupiedVehicle(ped) then return end
    if not killer or not getElementType( attacker ) == "player" ) then end
    local px,py,pz = getElementPosition(ped)
    local kx,ky,kz = getElementPosition(killer)
    if getDistanceBetweenPoints3D(px,py,pz, kx,ky,kz) > 10 then return end
    killPed(ped, killer, 255, body_part, false)
    setWl(killer, 6.0, 60, "Você cometeu o crime de assassinato")

 

 

 

US:

I know almost nothing about scripts

I want to do that when one player kills the other he receives 6 levels of wanted

 

  • Other Languages Moderators
Posted

Por favor, utilize a ferramenta <> para postar scripts.

Acho exagero colocar nível de procurado máximo logo de cara, mas é você quem sabe.

function playerKilled (ammo, killer, weapon, bodypart)
    if killer then -- Se morreu por causa de alguém, então:
        if getElementType (killer) == "player" then -- Se quem matou for um jogador, então:
            setPlayerWantedLevel (killer, 6) -- O jogador que matou fica com nível 6 de procurado.
        elseif getElementType (killer) == "vehicle" then -- Se quem matou for um veículo, então:
            killer = getVehicleController (killer) -- Killer passa a ser quem está dirigindo o veículo que matou o jogador.
            if killer then -- Se existe alguém dirigindo o veículo, então:
                setPlayerWantedLevel (killer, 6) -- O motorista fica com nível 6 de procurado.
            end
        end
    end -- Se o jogador morreu por suicidio, nada acontece.
end
addEventHandler ("onPlayerWasted", getRootElement(), playerKilled)

E seu script não faz sentido algum.

  • Thanks 1
Posted
  1. function client_kill_ped(ped, killer, body_part)
  2.     if not ped or not isElement(ped) or isPedDead(ped) or getPedOccupiedVehicle(ped) then return end
  3.     if not killer or not isElement(killer) or not getPedOccupiedVehicle(killer) or getPedOccupiedVehicleSeat(killer) > 0 then return end
  4.     local px,py,pz = getElementPosition(ped)
  5.     local kx,ky,kz = getElementPosition(killer)
  6.     if getDistanceBetweenPoints3D(px,py,pz, kx,ky,kz) > 10 then return end
  7.     killPed(ped, killer, 255, body_part, false)
  8.     setWl(killer, 0.4, 60, "You committed the crime of murder")
  9. end

 

 

 

Queria trocar isso para um de quando um player mata o outro recebera nivel de procurado.

Tendeu?

obs: Não sei como posta as coisa aqui ainda e sei muito pouco de script 

  • Other Languages Moderators
Posted

Use isso para postar código.

O exemplo que postei faz exatamente o que você pediu no post: O jogador que matar o outro receberá 6 níveis de procurado.
Se você está querendo outra coisa, dai fica complicado.

  • Thanks 1
Posted
function playerKilled (ammo, killer, weapon, bodypart)
    if killer then -- Se morreu por causa de alguém, então:
        if getElementType (killer) == "player" then -- Se quem matou for um jogador, então:
            setWl (killer, 6, 180, "TESTE") -- O jogador que matou fica com nível 6 de procurado.
        elseif getElementType (killer) == "vehicle" then -- Se quem matou for um veículo, então:
            killer = getVehicleController (killer) -- Killer passa a ser quem está dirigindo o veículo que matou o jogador.
            if killer then -- Se existe alguém dirigindo o veículo, então:
                setWl(killer, 4, 180, "TESTE") -- O motorista fica com nível 6 de procurado.
            end
        end
    end -- Se o jogador morreu por suicidio, nada acontece.
end
addEventHandler ("onPlayerWasted", getRootElement(), playerKilled)

Muito obrigado agora esta funcionando perfeitamente 

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