Don't use spaces with the function :
function Car Color ( player )
if(isElementWithinMarker(player,marker2)) then
local playerTeam = getPlayerTeam ( player )
if ( playerTeam ) then
local r, g, b = getTeamColor ( playerTeam )
setVehicleColor( Maverick, r, g, b )
end
end
end
addCommandHandler ( "comprar51", Car Color )
To
function Car_Color ( player )
if(isElementWithinMarker(player,marker2)) then
local playerTeam = getPlayerTeam ( player )
if ( playerTeam ) then
local r, g, b = getTeamColor ( playerTeam )
setVehicleColor( Maverick, r, g, b )
end
end
end
addCommandHandler ( "comprar51", Car_Color )