[Release] Roleplay Toolbox 2.0

Update 1.4


  • Added version checking.

  • Added radar button onto the html.

Update 1.5


  • Added a different engine function, the engine automatically starts. You can change this via uncommenting the original function in cl_toolbox.lua and commenting out the second one.
--[[
RegisterNetEvent('Engine')
 
local vehicles = {}
local State = {}
 
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if GetSeatPedIsTryingToEnter(GetPlayerPed(-1)) == -1 and not table.contains(vehicles, GetVehiclePedIsTryingToEnter(GetPlayerPed(-1))) then
            table.insert(vehicles, GetVehiclePedIsTryingToEnter(GetPlayerPed(-1)))
            table.insert(State, IsVehicleEngineOn(GetVehiclePedIsTryingToEnter(GetPlayerPed(-1))))
        elseif IsPedInAnyVehicle(GetPlayerPed(-1), false) and not table.contains(vehicles, GetVehiclePedIsIn(GetPlayerPed(-1), false)) then
            table.insert(vehicles, GetVehiclePedIsIn(GetPlayerPed(-1), false))
            table.insert(State, IsVehicleEngineOn(GetVehiclePedIsIn(GetPlayerPed(-1), false)))
        end
        for i = 1, tablelength(vehicles) do
            if (GetPedInVehicleSeat(vehicles[i], -1) == GetPlayerPed(-1)) or IsVehicleSeatFree(vehicles[i], -1) then
                SetVehicleEngineOn(vehicles[i], State[i], State[i], State[i])
            end
        end
    end
end)
 
AddEventHandler('Engine', function()
    local veh
    local StateIndex
    for i = 1, tablelength(vehicles) do
        if vehicles[i] == GetVehiclePedIsIn(GetPlayerPed(-1), false) then
            veh = vehicles[i]
            StateIndex = i
        end
    end
    if IsPedInAnyVehicle(GetPlayerPed(-1), false) then
        if (GetPedInVehicleSeat(veh, -1) == GetPlayerPed(-1)) then
            if IsVehicleEngineOn(veh) then
                State[StateIndex] = false
            else
                State[StateIndex] = true
            end
        end
    end
end)
 --]]

function EngineToggle()
    player = GetPlayerPed(-1)
    local vehicle = GetVehiclePedIsIn(player, false)
    if IsVehicleEngineOn(vehicle) then
        SetVehicleEngineOn(vehicle, false, false, true)
        SetVehicleUndriveable(vehicle, true)
    else
        SetVehicleEngineOn(vehicle, true, false, true)
        SetVehicleUndriveable(vehicle, false)
    end
end

Give me a sec.

(20 Chars)

Should be fixed now, download the latest version from GitHub.

not sure if this be suggested or not but a Breathalyzer, civ could set an amount & cop can check

Already exists, however NIC who created the code doesn’t want it included, so I am respecting his wishes.

You could add your own :wink:

1 Like

can you try to add the radar to the toolbox were you dont need it installed on your server

iam trying but i cannot get it to work

Then mess around with the code, it works for me, I can’t tell you or release it due to the code creators wishes.

Download the radar and add it to the client toolbox file or add it as a separate client file and add it to the resource file and then trigger the event.

Hey whenever I hit M click something it does not work then I can’t exit the menu

Whats your resource name?

Make sure to read this

If you want to rename the resource, make sure to change this on line 78

"$.post( “http://resource-name/ 19” + name, JSON.stringify( data ), function( datab ) {"

To whatever you renamed the resource.

You can fix that by setting resource current name as a var in your JS then passing current resource name to it when the script starts.

SendNUIMessage({
        resourcename = GetResourceName()
})
var resourceName = ""; 

window.addEventListener( 'message', function( event ) {
        var item = event.data;

        if ( item.resourcename ) {
            resourceName = item.resourcename;
        }
} );

Something like that ^ JS might be wrong tho cause I am crap at JS.

1 problem. I cant get out of the menu? @BabbaTundaee

The menu works perfect - must of installed it incorrectly

What are you even talking about… What is your resource name.