[Release] Indicators with automatic turnoffs

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.
  • Changed for loop to 0,31 (Thanks @benzon83)
  • Changed usage of NetworkIsPlayerActive (Thanks @benzon83)

Version 1.0
pv-indicators.zip (1.6 KB)

15 Likes

thx it’s perfect, good job !

Works Perfect! Bravo!!!

What button do you press for them?

Arrow keys: Left key- Left, Right key- right, Down key- Off / Hazards

[Sorry for reviving a dead thread]

1 Like

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

That is a Very Nice find.

The 512 is Something i forgot to change back to 32. The script was originally made for another Server that allowed 512 players.

The thing about ids im not sure about though. But thanks for pointing it out.

It should actually only be 0, 31 forgot 0 counts to hehe :smiley:

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.

https://github.com/Stadus/Stadus_Scoreboard/blob/master/scoreboard.lua

for i = 0, 31 do
        if NetworkIsPlayerActive(i) then
            table.insert(players, i)
        end
end

Version 1.1 UPDATE

  • Added project to Github for better contribution possibilities.
  • Changed for loop to 0,31 (Thanks @benzon83)
  • Changed usage of NetworkIsPlayerActive (Thanks @benzon83)

Nice one @asser90 good call with github.

1 Like

@asser90 Really nice work!

1 Like

how do I increase the light intensity?

Hi,

Is there a way of stopping this using the controller please?

Kind regards,

Shane

2 Likes

GetLastInputMethod(0)

I proposed a change:

Good morning all.

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

Hello. Is there any way to make not only the turn signals flash but also the lights? There are indeed vehicles without turn signals, unfortunately.