ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleWindowTint

Function

setVehicleWindowTint

New function!Added to Trilogy Hub on 2 Nov 2026.

ServerVehiclesTrilogy Hub only

Tints a vehicle's windows for every player and can give them a light colour. The darkest is 80% - a higher value also gives 80%, because the glass should still look like glass: reflections stay and you can still see a bit of the interior. The colour only tints the glass, the darkening does most of the work. Darkness 0 without a colour restores the normal windows.

Syntax

bool setVehicleWindowTint(vehicle vehicle, int darkness [, int r = nil, int g = nil, int b = nil])

Arguments

vehiclevehicle
The vehicle.
darknessint
Darkness in percent 0-80.
rint, optional = nil
Red colour component 0-255; without a colour the windows are only darkened.
gint, optional = nil
Green colour component 0-255.
bint, optional = nil
Blue colour component 0-255.

Returns

true on success.

Example

addCommandHandler("szyby", function(player, _, percent)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then setVehicleWindowTint(vehicle, tonumber(percent) or 60) end
end)

See also