Jump to content

Color


Arsilex

Recommended Posts

Hola en muchos servidores race eh visto que el color de loc coches es mas vivo y en mi caso en mi sv los colores son del GTA normal como puedo cambiarlo ay alguen archivo o algo??????

o tengo que crear un script que cuando empieza el mapa se cambie a un color aleatorio de los que yo ponga

tambien pense en cojer el vehclepicker de freeroam pero no me funciona por que tengo que ponerlo en un gui creo ._.

Link to comment
  
function Color(theVehicle) 
    color1=setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) 
    color2=setVehicleColor2 ( theVehicle, 0, 255, 0, 0, 255, 0 ) 
    color3=setVehicleColor3 ( theVehicle, 0, 255, 0, 0, 255, 0 ) 
math.random = color1,color2,color3 
end 
  

asi queria mas o menos?

Edited by Guest
Link to comment
function Colores(theVehicle) 
Color1=setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) 
Color2=setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) 
Color3=setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) 
Color4=setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) 
Color5=setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) 
  
math.random (Color (1,2,3,4,5)) 
end 
  
addEvent("ChangeVehicleColor", true) 
addEventHandler("ChangeVehicleColor",getRootElement(),Colores) 
  

asi estaria bien?

Link to comment
  
function doColorChange(theVehicle) 
    setVehicleColor (theVehicle, math.random(255),math.random(255),math.random(255),math.random(255)) 
end 
addEvent("changevehiclecolor", true) 
addEventHandler("changevehiclecolor",getRootElement(),doColorChange) 

eso sirve ?

Link to comment
function doColorChange(theVehicle) 
    setVehicleColor (theVehicle, math.random(255),math.random(255),math.random(255),math.random(255)) 
end 
addEvent("changevehiclecolor", true) 
addEventHandler("changevehiclecolor",getRootElement(),doColorChange) 
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), doColorChange ) 

Link to comment
function doColorChange() 
    for i, car in ipairs( getElementsByType( "vehicle" ) ) do 
        local color = {} 
        color[1] = math.random(255) 
        setVehicleColor ( car, color[1] ) 
    end 
end 
  
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), doColorChange ) 

esto es lo ultimo que se me vino a la cabeza ya no tengo mas ideas :S

Link to comment
function doColorChange(doColorChange,Source) 
    setVehicleColor (Source, math.random(255),math.random(255),math.random(255),math.random(255)) 
end 
addEvent("changevehiclecolor", true) 
addEventHandler("changevehiclecolor",getRootElement(),doColorChange) 
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), doColorChange ) 

asi dices tu?

Link to comment

Asi:

addEventHandler ( 'onClientResourceStart', resourceRoot, 
    function ( ) 
        for _, car in ipairs ( getElementsByType 'vehicle' ) do 
            setVehicleColor ( car, math.random ( 0, 255 ), math.random ( 0, 255 ), math.random ( 0, 255 ) ); 
        end 
    end 
) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...