Jump to content

AJUDA Codigo trancar veiculo MTA


Recommended Posts

Olá pessoal estou com outro problema diferente agora, basicamente tou com um mod de trancar veiculos aqui porem ele veio com o som de trancar veiculo muito feio, consegui trocar o som quando o player tranca o veiculo sem estar nele porem tou tendo dificuldades para conseguir colocar um som diferente se o player estiver dentro do veiculo

server side

function doToggleLights ( source, beep )
	local theVehicle 
	if ( getElementType(source) == "vehicle" ) then
		theVehicle = source
	end
	if ( getElementType(source) == "player" ) then
		theVehicle = getElementData ( source, "cl_ownedvehicle" )
	end
	if ( theVehicle ) then
	if (getElementType(source) == "player") then 
        if not (getPedOccupiedVehicle(source)) then
		if ( getVehicleOverrideLights ( theVehicle ) ~= 2 ) then  -- if the current state isn't 'force on'
            setVehicleOverrideLights ( theVehicle, 2 )            -- force the lights on
			-- play sound close to element
			if ( beep == true ) then
				local theElement = theVehicle
				triggerClientEvent ( getRootElement(), "playSoundLockOut", getRootElement(), theElement, 5)
			end
        else
            setVehicleOverrideLights ( theVehicle, 1 )            -- otherwise, force the lights off
        end
		else
			if ( beep == true ) then
				local theElement = theVehicle
				triggerClientEvent ( getRootElement(), "playSoundLockIn", getRootElement(), theElement, 5)
			end
        end
		end
	else
    end
end

Obrigado a quem puder ajudar

Principalmente ao @Lord Henryque tem me ajudado bastante aqui! :)

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