This is a project by Asser and Kleb that makes indicators work on vehicles. The indicators will automaticly turn off when you have turned. The project also comes with hazardlights.
I hope you will enjoy.
Controls
Arrow left (Indicator Left)
Arrow Right (Indicator Right)
Arrow Down (Hazard Lights)
Download
Version 1.1
Added project to Github for better contribution possibilities.
I know it’s an old thread, and not sure if the Dev is still keeping up with FiveM.
But found one thing that creating bad performance in this script with out doubt!
Added the code in question in the end of this post, first of all why the heck dos it do a for loop from 0 to 512, currently fivem is limited to 32 players, and this loop should be 0,32 with out doubt.
And the code NetworkIsPlayerActive(GetPlayerFromServerId(playerIds)) im pretty sure you could change that in to just NetworkIsPlayerActive(playerIds) - these 2 changed mad the script go from 0.52 ms to 0.06 ms.
for playerIds = 0,512 do
if NetworkIsPlayerActive(GetPlayerFromServerId(playerIds)) then
local networkPed = GetPlayerPed(GetPlayerFromServerId(playerIds))
local networkPedVeh = GetVehiclePedIsIn(networkPed, false)
if networkPedVeh ~= nil and networkPedVeh ~= false and GetPlayerFromServerId(playerIds) ~= PlayerId() and GetPedInVehicleSeat(networkPedVeh, -1) == networkPed and IsVehicleEngineOn(networkPedVeh) then
if GetEntitySpeed(networkPedVeh) < 2 then
SetVehicleBrakeLights(networkPedVeh, true)
end
end
end
end
It should actually only be 0, 31 forgot 0 counts to hehe
The other thing, just took a look ad Stardus Scoreboard and the way it add’s players to it’s table uses the same call’s so NetworkIsPlayerActive(playerIds) should work.
Think it’s worth taking a look ad and doing some test with, since it would remove 1 native call.
And the question is if the loop should only run if you are in a car, i know if you are on foot the break light wont show up, but again how important is that part when you are on foot, compared to when you are in a car.
very beautiful resource works perfectly But I ask myself questions to simplify the configuration of the keys will it not be interesting to make a config file with
activate / deactivate turn signals
hazard lights
Provide Change the assignment of the turn signal activation key
hazard lights
and also create a notification when the hazard warning lights are On or Off