Scene Menu Traffic Policer

roleplay
cops
fivem
server
#21

Amazing Script, love how it like merges 2 into one. :slight_smile: Keep it up!

1 Like
#22

Ok, I’ll test it out this weekend! Thankyou man! And love the script entirely, keep up the good work!

1 Like
#23

good job

1 Like
#24

You can’t have chat commands in a

Citizen.CreateThread(function()
while true do

It will cause high memory issues

#25

So you will have to redo it around the chat command?

#26

No, just make it like this:

Citizen.CreateThread(function()
  while true do
      Citizen.Wait(0)
      _menuPool:ProcessMenus()
  end
end)

RegisterCommand('scenemenu', function(source, args, rawCommand)
    trafficmenu:Visible(not trafficmenu:Visible())
end, false)
1 Like
#27

Apologies, yes thank you for correcting that

1 Like
#28

I already have a NativeUI installed for another script (server side eup). Can I rename the nativeui folder in this plugin to like “nativeui1” as long as I make necessary edits, or is there a way to safely co-exist the two programs without one over-writing the other menu?

1 Like
#29

I’m not entirely sure, this isn’t something i’ve had to test but renaming it SHOULD work theoretically. Trial and error I suppose

#30

I installed this last night and played around with it for an hour… All I got to say is… BRAVO man… this is and excellent script. I was able to rp many things with it… I even did a road construction at night scene that cause the hp to show up to direct traffic. Bravo

1 Like
#31

Thank you

#32

your welcome…

#33

is there a way to restrict peds on it? Like make it so only some peds can open it

1 Like
#34

I made it that this menu uses police check so that only police can use it, but i need someone to make it that the script check status, now its only when you are police and reconnect.

#35

How do you change the key to open the menu to another one?

#36

I’m needing to change it to F3

#37

Hey is ther a option to change the keybinding

#38

Absolutely!

Citizen.CreateThread(function()
  while true do
      Citizen.Wait(0)
      _menuPool:ProcessMenus()
      if IsControlJustPressed(0, 166) and GetLastInputMethod( 0 ) then
        allowedmodel = "s_m_y_cop_01"
        model = GetEntityModel(PlayerPedId())
        model2 = GetHashKey(allowedmodel)
        if model == model2 then
          trafficmenu:Visible(not trafficmenu:Visible())
        else 
          print("You need to be in the ped " .. allowedmodel)
        end
      end
  end
end)
#39

Yep, all you’d need to do is have a look through here…
https://docs.fivem.net/game-references/controls/

For the key that you want to use and take note of the ‘Index’ number.

Then, change this part…

 if IsControlJustPressed(0, 166) and GetLastInputMethod( 0 ) then

to reflect the key you want to use, for example…

 if IsControlJustPressed(0, 170) and GetLastInputMethod( 0 ) then

which will change the key to F3.

Full Example for F3:

Citizen.CreateThread(function()
  while true do
      Citizen.Wait(0)
      _menuPool:ProcessMenus()
      if IsControlJustPressed(0, 170) and GetLastInputMethod( 0 ) then
        allowedmodel = "s_m_y_cop_01"
        model = GetEntityModel(PlayerPedId())
        model2 = GetHashKey(allowedmodel)
        if model == model2 then
          trafficmenu:Visible(not trafficmenu:Visible())
        else 
          print("You need to be in the ped " .. allowedmodel)
        end
      end
  end
end)
#40

Not entirely sure what you mean by this.