[DEPRACATED] Scene Menu Traffic Policer

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

1 Like

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

1 Like

good job

1 Like

You canā€™t have chat commands in a

Citizen.CreateThread(function()
while true do

It will cause high memory issues

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

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

Apologies, yes thank you for correcting that

1 Like

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

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

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

Thank you

your welcomeā€¦

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

1 Like

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.

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

Iā€™m needing to change it to F3

Hey is ther a option to change the keybinding

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)

Yep, all youā€™d need to do is have a look through hereā€¦

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)

Not entirely sure what you mean by this.