Tonyx97 Posted October 17, 2012 Share Posted October 17, 2012 Hola a todos, siempre he estado con esta duda... como puedo cambiar el color de un marcador creado desde otra funcion? ejemplo: function marker () local marker1 = createMarker ( 2794.899, -2463.6, 12.6, "cylinder", 1.5, 255, 255, 255, 150 ) end addCommandHandler ("create", marker) function changeColor () setMarkerColor ( marker1, 255, 0, 0, 150 ) end addCommandHandler ("color", changeColor) GRACIAS POR LEER, ESPERO QUE ME AYUDEN Link to comment
Renkon Posted October 17, 2012 Share Posted October 17, 2012 Al poner LOCAL, te va a tirar error porque no hay definicion de marker1. Sacale el LOCAL Link to comment
Araa Posted October 17, 2012 Share Posted October 17, 2012 local marker1 function marker () marker1 = createMarker ( 2794.899, -2463.6, 12.6, "cylinder", 1.5, 255, 255, 255, 150 ) end addCommandHandler ("create", marker) function changeColor () setMarkerColor ( marker1, 255, 0, 0, 150 ) end addCommandHandler ("color", changeColor) Link to comment
Recommended Posts