aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Faltaba un "end" pero siguen sin salir ahora. local delanteros = { --Nombre, id, precio, vehiculo {"Slamin", 1188, 200, "Savanna"}, {"Chrome", 1189, 200, "Savanna"}, {"Slamin", 1190, 200, "Tornado"}, {"Chrome", 1191, 200, "Tornado"}, {"Slamin", 1185, 200, "Remington"}, {"Chrome", 1179, 200, "Remington"}, {"Slamin", 1181, 200, "Blade"}, {"Chrome", 1182, 200, "Blade"}, {"Chrome", 1176, 200, "Broadway"}, {"Chrome", 1174, 200, "Broadway"}, {"Alien", 1169, 200, "Sultan"}, {"X-Flow", 1170, 200, "Sultan"}, {"Alien", 1171, 200, "Elegy"}, {"X-Flow", 1172, 200, "Elegy"}, {"Alien", 1160, 200, "Jester"}, {"X-Flow", 1173, 200, "Jester"}, {"Alien", 1166, 200, "Uranus"}, {"X-Flow", 1165, 200, "Uranus"}, {"Alien", 1155, 200, "Stratum"}, {"X-Flow", 1157, 200, "Stratum"}, {"Alien", 1153, 200, "Flash"}, {"X-Flow", 1152, 200, "Flash"}, } windows.meca1 = { { type = "label", text = "Paragolpes", font = "bankgothic", alignX = "center", }, { type = "pane", panes = {} }, { type = "button", text = "Cerrar", alignX = "center", onClick = function() hide() showCursor(false) destroyElement() end, } } addEventHandler("onClientVehicleEnter", getRootElement(), function() if getVehicleName(source) == node[4] then windows.meca1[2].panes = {} for index, node in ipairs ( delanteros ) do table.insert( windows.meca1[2].panes, { image = ":players/images/skins/-1.png", title = "Parachoques "..node[1], text = "Cuesta "..node[3].."\nUn bonito parachoques para tu coche a un precio económico.", onHover = function( cursor, pos ) dxDrawRectangle( pos[1], pos[2], pos[3] - pos[1], pos[4] - pos[2], tocolor( unpack( { 0, 255, 120, 31 } ) ) ) end, onClick = function( key ) if key == 1 then hide() showCursor(false) end end, wordBreak = true, } ) end end end ) Link to comment
Sensacion Posted August 24, 2015 Share Posted August 24, 2015 Bueno, si ya me fijé, copialo una vez más, creo que ya, je je je Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Ahora sí jaja. Muchas gracias Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Revivo por una cosa (soy un pesao, lo sé :c). Bueno, pues tengo triggeada la función de ponerle el upgrade al vehículo pero no entiendo por qué no va --Cliente triggerServerEvent("onPoner", getLocalPlayer(), node[2]) --Servidor function poner(thePlayer, node) local node = node[2] local vehicle = getPedOccupiedVehicle(thePlayer) if vehicle then if exports.players:takeMoney(thePlayer, 1000) then addVehicleUpgrade(vehicle, node) exports.chat:me(thePlayer, "comienza a instalar la mejora en el vehículo") setTimer(function() outputChatBox("Instalando la mejora...", thePlayer, 0, 255, 120) end, 5000, 1) setTimer(function() outputChatBox("Mejora instalada satisfactoriamente", thePlayer, 0, 255, 120) end, 7000, 1) else outputChatBox("No te puedes permitir la instalación de éste tuneo", thePlayer, 255, 0, 0) end else outputChatBox("No estás en un vehículo", thePlayer, 255, 0, 0) end end addEvent("onPoner", true) addEventHandler("onPoner", getRootElement(), poner) Link to comment
alex17 Posted August 24, 2015 Share Posted August 24, 2015 remplaza el trigger por esto triggerServerEvent("onPoner", localPlayer, localPlayer, node[2]) Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Lo puse pero sigue sin ponerselo Link to comment
Sensacion Posted August 24, 2015 Share Posted August 24, 2015 Borra esto local node = node[2] Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Borrado. ¿Debería ir ahora? Link to comment
Sensacion Posted August 24, 2015 Share Posted August 24, 2015 Estás mandando una variable numérica, no una tabla para usar el [2] Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Osea, ¿modifico el trigger o pongo local node = node? Lo segundo es estúpido :v Link to comment
Sensacion Posted August 24, 2015 Share Posted August 24, 2015 trigea como te dijo alex17, (aunque no es necesario mandar a localplayer como variable) y borra lo que te dije. Link to comment
alex17 Posted August 24, 2015 Share Posted August 24, 2015 el tirgger que te mande esta bien y necesitas poner localPlayer 2 veces el primero es el elemento al que estara atado el trigger y el segundo pone al jugador como variable ya que lo necesitas para tu funcion del server tu error esta en tu funcion pones local node = node[2] y node[2] no existe solo borra esa linea function poner(thePlayer, node) local node = node[2] --- debes borrar esto local vehicle = getPedOccupiedVehicle(thePlayer) if vehicle then if exports.players:takeMoney(thePlayer, 1000) then addVehicleUpgrade(vehicle, node) exports.chat:me(thePlayer, "comienza a instalar la mejora en el vehículo") setTimer(function() outputChatBox("Instalando la mejora...", thePlayer, 0, 255, 120) end, 5000, 1) setTimer(function() outputChatBox("Mejora instalada satisfactoriamente", thePlayer, 0, 255, 120) end, 7000, 1) else outputChatBox("No te puedes permitir la instalación de éste tuneo", thePlayer, 255, 0, 0) end else outputChatBox("No estás en un vehículo", thePlayer, 255, 0, 0) end end addEvent("onPoner", true) addEventHandler("onPoner", getRootElement(), poner) Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 Si, listo. Gracias por la ayuda a ambos PD: Se me queda el botón de cerrar D: Link to comment
alex17 Posted August 24, 2015 Share Posted August 24, 2015 y supongo que debemos adivinar la parte del codigo del boton cerrar ? Link to comment
Sensacion Posted August 24, 2015 Share Posted August 24, 2015 Yo lo hubiera usado así: triggerServerEvent("onPoner", localPlayer, node[2]) diferentes maneras... Link to comment
aka Blue Posted August 24, 2015 Author Share Posted August 24, 2015 { type = "button", text = "Cerrar", alignX = "center", onClick = function() hide() showCursor(false) destroyElement() end, } PD: Ni caso al destroyElement, lo tengo quitado en mi sv... Link to comment
alex17 Posted August 25, 2015 Share Posted August 25, 2015 { type = "button", text = "Cerrar", alignX = "center", onClick = function() hide() showCursor(false) destroyElement() end, } esa parte no ayuda de mucho eso es todo el codigo ? Link to comment
aka Blue Posted August 25, 2015 Author Share Posted August 25, 2015 windows.meca1 = { { type = "label", text = "Paragolpes", font = "bankgothic", alignX = "center", }, { type = "pane", panes = {} }, { type = "button", text = "Cerrar", alignX = "center", onClick = function() hide() showCursor(false) destroyElement() end, } } Link to comment
DBY Posted August 25, 2015 Share Posted August 25, 2015 ¿Por qué usas destroyElement()? Link to comment
aka Blue Posted August 25, 2015 Author Share Posted August 25, 2015 PD: Ni caso al destroyElement, lo tengo quitado en mi sv... Link to comment
Recommended Posts