Rainbow Vehicles! Make your vehicle fancy

I was a bit bored, and upon discorvering ash’s rainbow code, i decieded to make this, Rainbow Vehicles.

AS SEEN ON PRETTY MUCH EVERY MOD MENU IN EXISTENCE

How to use
Simply just do /vehrainbow then how fast you want it to fade into each colour!

E.G: /vehrainbow 5.5

NOTE: THIS IS A FLOAT! Make sure if you are choosing a number like 1, write it as 1.0, same goes with every number!

Download!

Video:
http://illusivetea.me/WhyIsThereSoManyFuckingRpServers/5Ze68A142.mp4

2 Likes

I hope its not too much to ask but could you make a version that uses essentialmode commands instead?

I dont use essentialmode :stuck_out_tongue: dont see why it would be too difficult to make tho :smiley:

Oh no, not again. Is there anything you make that doesn’t involve :rainbow:s? :stuck_out_tongue_winking_eye:

1 Like

Just rainbow fading is so cool to me and idek why

1 Like

cough cough GAY
… but the body seems unclear, is it a complete sentence?

Nah fam




:rainbow: :rainbow: :rainbow:

1 Like

… why, though? and why is ‘essentialmode’ not using the native command functionality?

2 Likes

I modify the script - idea that only “mechanic” can use this script, but its doesn’t work… anyone see an error, please?

local toggle 		= false
local rainbowveh 	= false
local speed 		= 0.23

-- Crashing

TriggerEvent('es:addGroupCommand', 'rainbow', "mechanic" , function(source, args, user)
    toggle = not toggle
    if toggle then
        rainbowveh = true
        TriggerEvent("chatMessage", "", {255,255,255}, "Mechaniker Event: ^2^*Aktiviert")

    else
        rainbowveh = false
        TriggerEvent("chatMessage", "", {255,255,255}, "Mechaniker Event: ^8^*Deaktiviert")
    end
    for k,v in pairs(args) do
        if k == 1 then
            speed = v
        end
    end
end, function(source, args, user)
    TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Du hast keine Berechtigung!")
end, {help = "Nur ein Testbefehlsding, yeah!", params = {{name = "speed", help = "Die Geschwindigkeit, mit der sich die Farbe ändert."}}})

RegisterCommand("rainbow", function(source, args, rawCommand)
    toggle = not toggle
    if toggle then
        rainbowveh = true
        TriggerEvent("chatMessage", "", {255,255,255}, "Mechaniker Event: ^2^*Aktiviert")

    else
        rainbowveh = false
        TriggerEvent("chatMessage", "", {255,255,255}, "Mechaniker Event: ^8^*Deaktiviert")
    end
    for k,v in pairs(args) do
        if k == 1 then
            speed = v
        end
    end
end,false)

else 

Citizen.CreateThread(function()
    local function RGBRainbow( frequency )
        local result = {}
        local curtime = GetGameTimer() / 1000

        result.r = math.floor( math.sin( curtime * frequency + 0 ) * 127 + 128 )
        result.g = math.floor( math.sin( curtime * frequency + 2 ) * 127 + 128 )
        result.b = math.floor( math.sin( curtime * frequency + 4 ) * 127 + 128 )

        return result
    end
    while true do
        local rainbow = RGBRainbow( speed )
        Citizen.Wait(0)
        if rainbowveh then
            if IsPedInAnyVehicle(PlayerPedId(), true) then
                veh = GetVehiclePedIsUsing(PlayerPedId())
                SetVehicleCustomPrimaryColour(veh, rainbow.r, rainbow.g, rainbow.b)
                SetVehicleCustomSecondaryColour(veh, rainbow.r, rainbow.g, rainbow.b)
            else
                rainbowveh = false
                toggle = false
            end
        end
    end
end)

group here is the superadmin, admin, moderator, etc… not the job, if you want only mechanics use this command you need to manually add it to the server.cfg with add_ace permission