Jump to content

Nao funcionou


Recommended Posts

Estou tentando fazer que quando o veiculo chega a um certo nivel de dano o veiculo desliga, podem me ajudar?

>> nao funcionou

function stopengine(player,seat)
    local vehp = getPedOccupiedVehicle(source)
    local health = getElementHealth(vehp)
    if health <= 300 then
        setVehicleEngineState(vehp, false)
    end
end
addEventHandler("onVehicleDamage",root,stopengine)

 

Edited by Lord Henry
Código convertido de texto para Lua.
Link to comment

Não está funcionando

[10:38:28] WARNING: [G]S_PainelVeiculo\server.Lua:138: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got vehicle]
[10:38:28] WARNING: [G]S_PainelVeiculo\server.Lua:139: Bad argument @ 'getElementHealth' [Expected element at argument 1, got boolean]
[10:38:28] ERROR: [G]S_PainelVeiculo\server.Lua:140: attempt to compare boolean with number

Esse é o console

Link to comment
  • DNL291 locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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