- Documentation
- Server functions
- setVehicleWindowTint
Function
setVehicleWindowTint
New function!Added to Trilogy Hub on 2 Nov 2026.
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
getVehicleWindowTintReturns the vehicle's window darkness in percent (0 = normal windows) and, if a colour is set, also its r, g, b components.setVehicleColorSets a vehicle's paint colours as any RGB colours, visible to every player. A vehicle has up to four colours: 1 = main paint, 2 = second colour (stripes, roof, rims depending on the model), 3 and 4 = extra parts of some models. Pass only the first three numbers and the second colour will match the first. Colours not in the game palette are drawn exactly, without rounding to the palette.