Arsilex Posted March 27, 2012 Share Posted March 27, 2012 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
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Que yo sepa estas hablando del Car Paint: https://wiki.multitheftauto.com/wiki/Sha ... #Car_paint Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 no ablo de colores mira los colores de MTA race de coches por defecto es del 1 asta 128 yo quero acer que sea de 128 a 255 Link to comment
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Ah, estas hablando de los colores R, G, B, esos los podes usar en setVehicleColor. Esto le pone el color rojo y verde a un vehiculo: setVehicleColor ( theVehicle, 255, 0, 0, 0, 255, 0 ) Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 y para ponerlo que sea random como se ace añado mas setvehiclecolor y pongo random o algo asi ._.como lo de chat ? Link to comment
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Usa la funcion: math.random Hace click en la funcion para obtener informacion sobre la misma. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 (edited) 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 March 27, 2012 by Guest Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 ok espera pensare otra cosa ._. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 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
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Por favor, podrias por lo menos leer el sintaxis de las funciones? setVehicleColor retorna un boolean: true o false. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 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
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Eso esta mejor, pero se que no lo hiciste vos. P.D: Te falto algo para ejecutar la funcion. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 miralo aora lo edite un poco Link to comment
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Eso funcionaria, si, pero sigue sin tener algo que lo ejecute. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 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
Castillo Posted March 27, 2012 Share Posted March 27, 2012 No te das cuenta que sigue sin tener sentido? 'theVehicle' no esta definido en ninguna parte. Te aconsejo que vuelvas a lo basico. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 como que a lo bascio? Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 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 Link to comment
Castillo Posted March 27, 2012 Share Posted March 27, 2012 Estas copiando y pegando, no estas estudiando las funciones. Link to comment
Arsilex Posted March 27, 2012 Author Share Posted March 27, 2012 e.é eso es que lo saque de un mapa Edit: es que tio no se que acerle pff Link to comment
Soren Posted March 27, 2012 Share Posted March 27, 2012 Tu error mas grande es que estas usando TheVehicle como algo definido. Usa source o player esos si estan. Link to comment
Arsilex Posted March 28, 2012 Author Share Posted March 28, 2012 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
drk Posted March 28, 2012 Share Posted March 28, 2012 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
Recommended Posts