addCommandHandler( { "setvehiclecolor", "setcolor" },
function( player, commandName, other, r, g, b, r2, g2, b2 )
local r = tonumber ( r ) or 0
local g = tonumber ( g ) or r
local b = tonumber ( b ) or g
local r2 = tonumber ( r2 )
local g2 = tonumber ( g2 )
local b2 = tonumber ( b2 )
if ( other and r and g and b >= 0 and r <= 255 and g >= 0 and g <= 255 and b >= 0 and b <= 255 ) then
local other, name = exports.players:getFromName ( player, other )
if ( other ) then
local vehicle = getPedOccupiedVehicle ( other )
if ( vehicle ) then
local data = vehicles [ vehicle ]
if ( data ) then
if ( data.vehicleID < 0 or exports.sql:query_free ( "UPDATE vehicles SET color1 = " .. toJSON ( { r, g, b } ) .. ", color2 = " .. toJSON ( { r2, g2, b2 } ) .. " WHERE vehicleID = " .. data.vehicleID ) ) then
setVehicleColor ( vehicle, r, g, b, r2, g2, b2 )
outputChatBox ( "Changed the color of " .. name .. "'s " .. getVehicleName ( vehicle ) .. ".", player, 0, 255, 153 )
else
outputChatBox ( "MySQL Query failed.", player, 255, 0, 0 )
end
else
outputChatBox ( "Vehicle Error.", player, 255, 0, 0 )
end
else
outputChatBox ( name .. " isn't driving a vehicle.", player, 255, 0, 0 )
end
end
else
outputChatBox ( "Syntax: /" .. commandName .. " [player] [r] [g] [b]", player, 255, 255, 255 )
end
end,
true
)
Proba eso.