Olá, peguei um script de exemplo no site do MTA que usa a função getPedOccupiedVehicle.
O problema é o seguinte, o código sempre retorna para mim que não estou em um veículo (mesmo dirigindo ava). O meu script está funcionando como client.
function showVehicleName ( thePlayer )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
if theVehicle then
outputChatBox ( "Name of the Vehicle: " .. getVehicleName ( theVehicle ), thePlayer )
else
outputChatBox ( "You do not have a Vehicle!", thePlayer, 255, 0, 0, true )
end
end
addCommandHandler ( "getcarname", showVehicleName )
meta.xml:
<meta>
<script src="script.lua" type="client" />
</meta>
O que pode ser? Já usei também o getPlayerOccupiedVehicle e continua igual. Alguém?
Fonte: https://wiki.multitheftauto.com/wiki/Ge ... iedVehicle