Jump to content

LuFeMAR

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by LuFeMAR

  1. Hola, muchas gracias amigo por todo, sin embargo estuve probando el código y me doy cuenta que solo abre la ventana pero no abren los botones, ni la información de la ventana, solo la ventana vacía.. entonces me puse a probar de distintas maneras con el mismo código y logre hacer que apareciera todo, sin embargo a pesar de que logre de que apareciera la ventana completa, cuando lo cerraba seguía el error y no podía volverlo a abrir :/.. pero bueno brouh igualmente muchas gracias, se intento de todo jeje
  2. Uff muchas gracias amigo, disculpa responder tarde, sin embargo me doy cuenta que cuando lo abro y lo cierro, no me deja volver a abrirlo, me toca salir y volver entrar para que me pueda volver a abrir
  3. if not abririnmo then function abrirGUIConcesionario(sql) showCursor(true) ventana = guiCreateWindow(431, 215, 429, 455, "Interiores a la venta", false) guiWindowSetSizable(ventana, false) listatodos = guiCreateGridList(30, 44, 245, 387, false, ventana) guiGridListAddColumn(listatodos, "ID", 0.2) guiGridListAddColumn(listatodos, "Nombre", 0.5) guiGridListAddColumn(listatodos, "Precio", 0.2) rAct = 0 sigCat = 0 -- Categoría -- for i = 1, 2 do guiGridListAddRow(listatodos) if sigCat == 1 then rAct = rAct + 1 sigCat = 0 end guiGridListSetItemText(listatodos, rAct, 2, tostring(catVeh[i][1]), false, false) guiGridListSetItemColor(listatodos, rAct, 2, 0, 255, 0) for k, v in ipairs(sql) do if tonumber(v.interiorType) == tonumber(i) then rAct = (rAct+1) guiGridListAddRow(listatodos) guiGridListSetItemText(listatodos, rAct, 1, tostring(v.interiorID), false, false) guiGridListSetItemText(listatodos, rAct, 2, tostring(v.interiorName), false, false) guiGridListSetItemText(listatodos, rAct, 3, tostring(v.interiorPrice), false, false) end sigCat = 1 end end -- Fin Categoría -- botonmarcar = guiCreateButton(300, 290, 119, 56, "Marcar Posición", false, ventana) addEventHandler('onClientGUIClick', botonmarcar, regularBotonGUI) botoncerrar = guiCreateButton(300, 375, 119, 56, "Cerrar", false, ventana) addEventHandler('onClientGUIClick', botoncerrar, regularBotonGUI) precio = guiCreateLabel(257, 88, 152, 21, "", false, ventana) end end addEvent("abririnmo", true) addEventHandler("abririnmo", root, abrirGUIConcesionario) intente asi pero sigue duplicandose
  4. en mi cliente tengo el gui, el cual termina con: addEvent("abririnmo", true) addEventHandler("abririnmo", root, abrirGUIConcesionario)
  5. Hola, mi problema es que tengo un código que abre un menú cuando das click sobre el NPC creado, pero cuando le vuelves a dar click, teniendo el panel abierto, el panel se duplica teniendo 2 paneles que no se pueden cerrar y no se que puedo hacer para evitar esto. el código es el siguiente: local ped = createPed( 172, 1661.84375, -2514.427734375, 44.526222229004, 270.61660766602 ) setElementInterior ( ped, 3 ) setElementDimension ( ped, 12 ) addEventHandler( "onElementClicked", resourceRoot, function( button, state, player ) if button == "left" and state == "up" then local x, y, z = getElementPosition( player ) if getDistanceBetweenPoints3D( x, y, z, getElementPosition( source ) ) < 5 and getElementDimension( player ) == getElementDimension( source ) and source == ped then local sql = exports.sql:query_assoc("SELECT interiorID, interiorName, interiorPrice, interiorType FROM interiors WHERE characterID = 0 AND (interiorType = 1 OR interiorType = 2)") triggerClientEvent(player, "abririnmo", player, sql) setElementData(player, "abririnmo", true) end end end )
  6. actualmente estoy usando la GM de DT y solía usar host con Windows, los cuales usaba los módulos y el resto de archivos en formato .dll sin embargo he cambiado a un host que usa Linux , por lo que tuve que cambiar los módulos y descargarlos en formato .so sin embargo a pesar de esto.... el server no me abre: [20-10-23 19:46:00] Server stopped! [20-10-23 19:46:05] Stopping resources.... [20-10-23 19:46:05] Server shutdown as requested by resource sql (MySQL module missing.) [20-10-23 19:46:05] Start up of resource sql cancelled by script [20-10-23 19:46:05] Server shutdown as requested by resource sql (MySQL module missing.) [20-10-23 19:46:05] Start up of resource sql cancelled by script [20-10-23 19:46:05] Server shutdown as requested by resource sql (MySQL module missing.) [20-10-23 19:46:05] Start up of resource sql cancelled by script [20-10-23 19:46:05] Server shutdown as requested by resource sql (MySQL module missing.) [20-10-23 19:46:05] Start up of resource sql cancelled by script [20-10-23 19:46:05] Closing SQLite3 database por que sigue dando este error cuando se supone que ya he cambiado el formato de lso modulos?
  7. es muy raro, puesto que la misma funcion me funciona en otros recursos pero bueno, y si decido quitar esa función no abra ningún problema?
  8. Hola, gracias por responder... he usado el código que me enviaste: addCommandHandler( "taximetro", function( ) local vehiculo = getPedOccupiedVehicle ( localPlayer ) local vehiculos = getVehicleName ( vehiculo ) if vehiculos == "Taxi" then if exports.factions:IsPlayerInFaction(localPlayer,10) then setElementData( vehiculo, "distancia", type( getElementData( vehiculo, "distancia" ) ) ~= "number" and 0 or false ) end end end ) pero me dice: ERROR: taxidemetro\client.lua:6: call failed to call 'factions:IsPlayerInFaction' [string "?"]
  9. Hola, gracias por responder, he probado con el segundo código que me enviaste pero aun me sigue lanzando WARNINGS WARNING: taxidemetro\client.lua:3: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got nil] WARNING: taxidemetro\client.lua:4: Bad argument @ 'getElementModelO' [Expected ped at argument 1, got string 'taximetro'] addCommandHandler( "taximetro", function( theVehicle , commandName ) local vehiculo = getPedOccupiedVehicle( source ) local vehiculos = getElementModel ( theVehicle ) if vehiculos == 420 then if exports.factions:IsPlayerInFaction(player,10) then if vehiculo then setElementData( vehiculo, "distancia", type( getElementData( vehiculo, "distancia" ) ) ~= "number" and 0 or false ) end end end end ) Este fue el que use
  10. Hola , gracias por responder... he intentando lo que me dijiste pero igual sigue tirando Warnings y sigue sin funcionar. addCommandHandler( "taximetro", function( player, commandName ) local vehiculo = getPedOccupiedVehicle( player ) local vehiculos = getElementModel(vehiculo) if vehiculos == 420 then if exports.factions:IsPlayerInFaction(player,10) then if vehiculo and getVehicleOccupant( vehiculo ) == player then setElementData( vehiculo, "distancia", type( getElementData( vehiculo, "distancia" ) ) ~= "number" and 0 or false ) end end end end ) function taxi( ) local screenX, screenY = guiGetScreenSize( ) local distancia = getElementData( vehicle, "distancia" ) if distancia then texto = ("Taximetro: %.1f$"):format( distancia ) dxDrawText( texto, 4, 4, screenX, screenY * 0.98 + 2, tocolor( 0, 0, 0, 255 ), 1, "pricedown", "center", "bottom", false, false, true ) end end WARNING: taxidemetro\client.lua:3: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got string 'taximetro'] WARNING: taxidemetro\client.lua:4: Bad argument @ 'getElementModelO' [Expected ped at argument 1, got boolean]
  11. addCommandHandler( "taximetro", function( player, commandName ) local vehiculo = getPedOccupiedVehicle( player ) local vehiculos = getvehiclemodel(vehicle) if vehiculos == 420 then if exports.factions:IsPlayerInFaction(player,10) then if vehiculo and getVehicleOccupant( vehiculo ) == player then setElementData( vehiculo, "distancia", type( getElementData( vehiculo, "distancia" ) ) ~= "number" and 0 or false ) end end end end ) function taxi( ) local screenX, screenY = guiGetScreenSize( ) local distancia = getElementData( vehicle, "distancia" ) if distancia then texto = ("Taximetro: %.1f$"):format( distancia ) dxDrawText( texto, 4, 4, screenX, screenY * 0.98 + 2, tocolor( 0, 0, 0, 255 ), 1, "pricedown", "center", "bottom", false, false, true ) end end Tengo este taxímetro y yo veo todo bien peor al momento de iniciarlo me dice: WARNING: taxidemetro\client.lua:3 Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got string 'taximetro'] ERROR: taxidemetro\client.lua:4attempt to call global 'getvehiclemodel' (a nil value me salta este error y no me funciona, alguna idea?, no se que hacer
  12. Hola, Hace poco puse el recurso de localvoice teniendo la GM de DT(DownTown), pero esto me genero el error de que al presionar la z, se quedaba activado y aunque deje de presionar este seguía activo y nunca se desactivaba. te agradecería de corazón , si me pudieras ayudar a la correcta instalación de este.
×
×
  • Create New...