Cruise control and Tazer

2 things

First: using cops-fivem

  1. cuffed players don’t fall when getting tazed (also used a tazer scripts that lays you on the ground for a few seconds and didn’t work)
  2. cops fivem is whitelisted based to clock in but would like to make it group.leo (optional)

Second: Cruise control
I cant find a cruise control script that goes off a /command, everything i find it keybind based and i dont want that. i seen some servers that use /cc “speed”, and its what im looking for. if someone can create a script for me that’ll be awsome

Maybe u can try something like this, sry can’t test it and was made it fast. This is for cruise control

CLIENT SIDE

RegisterNetEvent('cruiserCar')
AddEventHandler('cruiserCar', function(cruiserSpeed)
    local ped = PlayerPedId() -- Ped
    local inVehicle = IsPedSittingInAnyVehicle(ped) -- Get if ped is in any vehicle
    local vehicle = GetVehiclePedIsIn(ped, false) -- Get Vehicle In
    local vehicleModel = GetEntityModel(vehicle) -- Get Model

    if not inVehicle then
        return print("Not in vehicle") -- Notification not in vehicle
    end
    
    if not (GetPedInVehicleSeat(vehicle, -1) == ped ) then
        return print("Not driver seat") -- Notification not in driver seat
    end

    SetEntityMaxSpeed(vehicle, cruiserSpeed)
end

RegisterCommand('ccoff', function()
    local ped = PlayerPedId() -- Ped
    local inVehicle = IsPedSittingInAnyVehicle(ped) -- Get if ped is in any vehicle
    local vehicle = GetVehiclePedIsIn(ped, false) -- Get Vehicle In
    local vehicleModel = GetEntityModel(vehicle) -- Get Model
    local maxSpeed = GetVehicleMaxSpeed(vehicleModel) -- Get max speed to reset

    if not inVehicle then
        return print("Not in vehicle") -- Notification not in vehicle
    end

    if not (GetPedInVehicleSeat(vehicle, -1) == ped ) then
        return print("Not driver seat") -- Notification not in driver seat
    end

    SetEntityMaxSpeed(vehicle, maxSpeed)
end)

SERVER SIDED

RegisterCommand('cc', function(source, args)
    local cruiser = tonumber(args[1])
    if cruiser then
        TriggerClientEvent('cruiserCar', source, cruiser)
    else
        print("args NIL") -- Notification
    end
 end)

ok so the scrip works, but the issue is it freezes the car completely and not drivable anymore

i did have in ingame error where it expected “)” to be on line 17 near end to close “(” from line 2
so it looks like

AddEventHandler(‘cruiserCar’, function(cruiserSpeed)

local ped = PlayerPedId() -- Ped

local inVehicle = IsPedSittingInAnyVehicle(ped) -- Get if ped is in any vehicle

local vehicle = GetVehiclePedIsIn(ped, false) -- Get Vehicle In

local vehicleModel = GetEntityModel(vehicle) -- Get Model

if not inVehicle then

    return print("Not in vehicle") -- Notification not in vehicle

end



if not (GetPedInVehicleSeat(vehicle, -1) == ped ) then

    return print("Not driver seat") -- Notification not in driver seat

end

SetEntityMaxSpeed(vehicle, cruiserSpeed)

end)

Still not working? the error was i don’t put the ) on the end. If not working today i will test it

ok, if you ever get it working your should release it becaus i know a lot of people actually look for a script like this, just cant find them.
I also appreciate you help very much

i did set the “)” and the car would freeze as you can see what i sent you

Done, sorry for late but i had no time.
I post it alredy if u want to try it here is the link

awsome thanks man, you already got 550 views on it. but again can’t thank you enough for the script.

1 Like