Hi, Could someone write me a script to change the color of car for account Mafi? On the server, all cars are red.
addEventHandler( "onPlayerLogin", root, function( _, acc )
if getAccountName( acc ) == "Mef" then
local veh = getPedOccupiedVehicle( source );
if veh then setVehicleColor( veh, 86, 86, 0, 0 ); end;
end;
end );
How to combine it with that?
function randomVehColors()
for i, car in ipairs( getElementsByType( "vehicle" ) ) do
local color = {}
color[1] = math.random(5,5)
color[2] = math.random(5,5)
color[3] = math.random(5,5)
color[4] = math.random(5,5)
setVehicleColor ( car, color[1], color[2], color[3], color[4] )
end
end
setTimer( randomVehColors, 500, 0 )
Im try two and this change all players car color
Help me Thanks.