Jump to content

alex17

Members
  • Posts

    302
  • Joined

  • Last visited

Everything posted by alex17

  1. por que no pones el GUI en el mismo archivo del DX y solo usas guiSetVisible
  2. muéstrame la parte del GUI
  3. mm no te entendí bien que quieres hacer pero si quieres abrir otro panel dx no es necesario un trigger
  4. ok no hay problema suerte espero te sirva
  5. mm ya encontre el problema le estas poniendo mucho ancho y largo tu error dxDrawRectangle(441, 297, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Reparar", 440, 297, 587, 330, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) ----- isCursorOnElement ( 440, 297, 587, 330) -- le estas poniendo el ancho y largo del dxText y deberia ser el ancho y largo del dxRectangle copia esta parte y reemplazarlo y ya debe de funcionarte bien PD: ya lo probe para que no haya mas errores function repararlo ( ) if isCursorOnElement ( 440, 297, 146, 32) then triggerServerEvent ( "onReparar", getLocalPlayer() ) removeEventHandler ( "onClientRender", root, panelsito ) elseif isCursorOnElement ( 440, 348, 146, 32 ) then triggerServerEvent ( "onPintar", getLocalPlayer() ) removeEventHandler ( "onClientRender", root, panelsito ) end end addEventHandler ( "onClientClick", getRootElement(), repararlo)
  6. mm y también se te cierra el panel donde le des ?
  7. prueba con esto function panelsito () dxDrawRectangle(344, 266, 334, 316, tocolor(127, 127, 127, 50), false) dxDrawRectangle(344, 179, 334, 87, tocolor(255, 255, 255, 40), false) dxDrawText("Panel Mecánico", 415, 206, 607, 256, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, false, false, false) dxDrawRectangle(344, 582, 334, 23, tocolor(255, 255, 255, 40), false) dxDrawRectangle(441, 297, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Reparar", 440, 297, 587, 330, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawText("Pintar", 440, 348, 587, 381, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawRectangle(441, 349, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawRectangle(441, 406, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Ruedas", 441, 406, 588, 439, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawText("Inflar", 441, 466, 588, 499, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawRectangle(441, 467, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawRectangle(441, 526, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Luces", 441, 525, 588, 558, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) showCursor (true) end function openPanel() addEventHandler ( "onClientRender", root, panelsito ) end addCommandHandler ("panel", openPanel) function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () if isCursorShowing() then else mx,my = x,y end local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function repararlo ( ) if isCursorOnElement ( 440, 297, 587, 330) then triggerServerEvent ( "onReparar", getLocalPlayer() ) removeEventHandler ( "onClientRender", root, panelsito ) elseif isCursorOnElement ( 440, 348, 587, 381 ) then triggerServerEvent ( "onPintar", getLocalPlayer() ) removeEventHandler ( "onClientRender", root, panelsito ) end end addEventHandler ( "onClientClick", getRootElement(), repararlo)
  8. function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end function as() dxDrawRectangle(344, 582, 334, 23, tocolor(255, 255, 255, 40), false) -- imaginando que este sera tu boton para cerrar tu dxpanel end function cerrarpanel ( ) if isMouseInPosition ( 344, 582, 334, 23) then -- los dos primeros argumentos seran la posicion x e y , los dos siguientes ancho y largo del boton removeEventHandler ( "onClientRender", root, as ) end end addEventHandler ( "onClientClick", getRootElement(), cerrarpanel)
  9. por si aun necesitas por tu problema anterior te dejo esto server function panelmeca(playerSource) if exports.players:isPlayerInFaction (playerSource, 4) then triggerClientEvent ( playerSource, "openPanel", playerSource) else outputChatBox ("No eres mecánico.", playerSource, 255, 0, 0) end end addCommandHandler ( "mecanico", panelmeca ) client function panelmeca () Panel = guiCreateWindow(355, 186, 434, 338, "Panel de mecánico", false) guiWindowSetSizable(Panel, false) guiSetAlpha(Panel, 0.76) guiSetProperty(Panel, "CaptionColour", "FF140287") BotonReparacion = guiCreateButton(17, 41, 152, 81, "Reparación ", false, Panel) guiSetAlpha(BotonReparacion, 0.48) guiSetFont(BotonReparacion, "sa-header") guiSetProperty(BotonReparacion, "NormalTextColour", "FF03932C") Gasolina = guiCreateButton(268, 41, 152, 81, "Gasolina", false, Panel) guiSetAlpha(Gasolina, 0.50) guiSetFont(Gasolina, "sa-header") guiSetProperty(Gasolina, "NormalTextColour", "FF03932C") Luz2 = guiCreateButton(267, 228, 152, 81, "Luz2", false, Panel) guiSetAlpha(Luz2, 0.49) guiSetFont(Luz2, "sa-header") guiSetProperty(Luz2, "NormalTextColour", "FF03932C") Luz1 = guiCreateButton(21, 228, 152, 81, "Luz1", false, Panel) guiSetAlpha(Luz1, 0.54) guiSetFont(Luz1, "sa-header") guiSetProperty(Luz1, "NormalTextColour", "FF03932C") Grid = guiCreateGridList(18, 135, 402, 80, false, Panel) guiGridListAddColumn(Grid, "Precio", 0.3) guiGridListAddColumn(Grid, "Pieza", 0.3) for i = 1, 12 do guiGridListAddRow(Grid) end guiGridListSetItemText(Grid, 0, 1, "300$", false, false) guiGridListSetItemText(Grid, 0, 2, "Reparación", false, false) guiGridListSetItemText(Grid, 1, 1, "250$", false, false) guiGridListSetItemText(Grid, 1, 2, "Gasolina", false, false) guiGridListSetItemText(Grid, 2, 1, "50$", false, false) guiGridListSetItemText(Grid, 2, 2, "Luz1 Izquierda", false, false) guiGridListSetItemText(Grid, 3, 1, "50", false, false) guiGridListSetItemText(Grid, 3, 2, "Luz2 Derecha", false, false) CerrarPanelBoton = guiCreateButton(174, 312, 93, 16, "Cerrar panel", false, Panel) guiSetAlpha(CerrarPanelBoton, 0.46) guiSetProperty(CerrarPanelBoton, "NormalTextColour", "FFFFFFFF") showCursor (true) addEventHandler ("onClientGUIClick", CerrarPanelBoton, cerrarlo, false) addEventHandler ("onClientGUIClick", BotonReparacion, reparar, false) addEventHandler ("onClientGUIClick", Luz1, luz1, false) addEventHandler ("onClientGUIClick", Luz2, luz2, false) addEventHandler ("onClientGUIClick", Gasolina, gasolina1, false) end addEvent( "openPanel", true ) addEventHandler( "openPanel", localPlayer, panelmeca )
  10. function as () dxDrawRectangle(344, 266, 334, 316, tocolor(127, 127, 127, 50), false) dxDrawRectangle(344, 179, 334, 87, tocolor(255, 255, 255, 40), false) dxDrawText("Panel Mecánico", 415, 206, 607, 256, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, false, false, false) dxDrawRectangle(441, 297, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Reparar", 440, 297, 587, 330, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawText("Pintar", 440, 348, 587, 381, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawRectangle(441, 349, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawRectangle(441, 406, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Ruedas", 441, 406, 588, 439, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawText("Inflar", 441, 466, 588, 499, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawRectangle(441, 467, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawRectangle(441, 526, 146, 32, tocolor(255, 255, 255, 40), false) dxDrawText("Luces", 441, 525, 588, 558, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false) dxDrawRectangle(344, 582, 334, 23, tocolor(255, 255, 255, 40), false) end function openPanel() addEventHandler ( "onClientRender", root, as ) end addCommandHandler ("abrirlo", openPanel)
  11. la funciones Dx necesitan del evento onClientRender
  12. prueba con esto- function panelmeca () if exports.players:isPlayerInFaction (localPlayer, 4) then Panel = guiCreateWindow(355, 186, 434, 338, "Panel de mecánico", false) guiWindowSetSizable(Panel, false) guiSetAlpha(Panel, 0.76) guiSetProperty(Panel, "CaptionColour", "FF140287") BotonReparacion = guiCreateButton(17, 41, 152, 81, "Reparación ", false, Panel) guiSetAlpha(BotonReparacion, 0.48) guiSetFont(BotonReparacion, "sa-header") guiSetProperty(BotonReparacion, "NormalTextColour", "FF03932C") Gasolina = guiCreateButton(268, 41, 152, 81, "Gasolina", false, Panel) guiSetAlpha(Gasolina, 0.50) guiSetFont(Gasolina, "sa-header") guiSetProperty(Gasolina, "NormalTextColour", "FF03932C") Luz2 = guiCreateButton(267, 228, 152, 81, "Luz2", false, Panel) guiSetAlpha(Luz2, 0.49) guiSetFont(Luz2, "sa-header") guiSetProperty(Luz2, "NormalTextColour", "FF03932C") Luz1 = guiCreateButton(21, 228, 152, 81, "Luz1", false, Panel) guiSetAlpha(Luz1, 0.54) guiSetFont(Luz1, "sa-header") guiSetProperty(Luz1, "NormalTextColour", "FF03932C") Grid = guiCreateGridList(18, 135, 402, 80, false, Panel) guiGridListAddColumn(Grid, "Precio", 0.3) guiGridListAddColumn(Grid, "Pieza", 0.3) for i = 1, 12 do guiGridListAddRow(Grid) end guiGridListSetItemText(Grid, 0, 1, "300$", false, false) guiGridListSetItemText(Grid, 0, 2, "Reparación", false, false) guiGridListSetItemText(Grid, 1, 1, "250$", false, false) guiGridListSetItemText(Grid, 1, 2, "Gasolina", false, false) guiGridListSetItemText(Grid, 2, 1, "50$", false, false) guiGridListSetItemText(Grid, 2, 2, "Luz1 Izquierda", false, false) guiGridListSetItemText(Grid, 3, 1, "50", false, false) guiGridListSetItemText(Grid, 3, 2, "Luz2 Derecha", false, false) CerrarPanelBoton = guiCreateButton(174, 312, 93, 16, "Cerrar panel", false, Panel) guiSetAlpha(CerrarPanelBoton, 0.46) guiSetProperty(CerrarPanelBoton, "NormalTextColour", "FFFFFFFF") showCursor (true) addEventHandler ("onClientGUIClick", CerrarPanelBoton, cerrarlo, false) addEventHandler ("onClientGUIClick", BotonReparacion, reparar, false) addEventHandler ("onClientGUIClick", Luz1, luz1, false) addEventHandler ("onClientGUIClick", Luz2, luz2, false) addEventHandler ("onClientGUIClick", Gasolina, gasolina1, false) else outputChatBox ("No eres mecánico.", localPlayer, 255, 0, 0) end end addCommandHandler ("mecanico", panelmeca)
  13. Well I come to leave this resource I made some time ago but still has some bugs that lack of time I could not even finish but can also use him. This panel works with shaders and a work called renderTarget which is only available to users with a good memory, but the panel also has a version for users only bad memory of the animations are only 2D but design It is the same panel. (This is automatic for users with good memory will be in 3d and 2d only other) sorry for my very very very bad English https://community.multitheftauto.com/ind ... s&id=11728
  14. Bueno Hoy vendo a dejar este resource que hice ya hace un tiempo pero que aun tiene algunos errores que por falta de tiempo no he podido terminar pero aun asi puede utilizarle . Este panel funciona con shaders y una funciona llamada renderTarget que solo es disponible para usuarios con una mm digamos buena memoria , sin embargo el panel cuenta también con una versión para los usuarios de mala memoria solo que las animaciones serán solo en 2d pero el diseño del panel es el mismo . ( esto es automático los usuarios con buena memoria se les vera en 3d y a los demas solo en 2d ) Bueno eso es todo cualquier consulta o error que encuentre pueden dejármelo por PM https://community.multitheftauto.com/ind ... s&id=11728
  15. yo lo aria con interpolateBetween
  16. Well firstly hello everyone Today I am here to present a project that started about three months ago which is still in beta but already you can play the same way. the server consists of 2 teams -------------------------------------------------- ------------------------- The Team robots will have the following things: -at Presionar J turns on and off a jetpack They'll have super strength -------------------------------------------------- ------------------------- The Team of survivors can only use what is available on your computer weapons, cars, etc. -------------------------------------------------- ------------------------ The teams are restricted to levels depending on skills and weapons with each team. You can level up by killing users or killing robots who are all over the map, each level has a prize You can be money, weapons, private cars, etc. -------------------------------------------------- --------------------------- Ip: mtasa://74.91.127.248:22003 Foro: http://therealsurprise.hol.es/ FB : https://www.facebook.com/groups/realsurprise/
  17. Bueno primeramente hola a todos hoy vengo a presentarles un proyecto que inicie hace unos 3 meses el cual aun se encuentra en fase beta pero ya se puede jugar de igual manera . el servidor consiste en básicamente dos equipos uno de sobrevivientes y otro de robots --------------------------------------------------------------------------- El Equipo de robots tendra lo siguente: -Al precionar J se activara y desactivara un jetpack -Tendran super fuerza --------------------------------------------------------------------------- EL Equipo de sobrevivientes solo podrá hacer uso de lo que este disponible en su equipo armas,autos, etc -------------------------------------------------------------------------- Los equipos estan restringidos por niveles dependiendo las habilidades y armas que tengan cada equipo. Puedes subir de nivel matando usuarios o matando robots que esten por todo el mapa , cada nivel tiene un premio puedes ser dinero , armas, autos privados , etc . ------------------------------------------------------------------------------ Ip: mtasa://74.91.127.248:22003 Foro: http://therealsurprise.hol.es/ FB : https://www.facebook.com/groups/realsurprise/ algunas fotos
  18. prueba cambiando el 0 por un 10 local myFuente = dxCreateFont("fuentes/digital.ttf", 0) local myFuente = dxCreateFont("fuentes/digital.ttf", 10)
  19. los dxDrawRectangle no se mueven solos , lo mas seguro es que este dibujando esos dxDrawRectangle con la posición de tu cámara y al mover el mouse se mueve la cámara y obviamente los dxDrawRectangle postea tu código para poder ayudarte mejor
  20. quedaría mejor si no tuviera mucho espacio después de la ultima letra como dice ciber, no tienes que sumar nada solo colocar el ancho del rectangulo igual a lo que te da dxGetTextWidth
  21. ya has echo 3 post sobre lo mismo y eso no cambiara nada creo que no consegiras ningun scripter bueno que solo trabaje por un puesto de administrador .
  22. mm no te entendí nada podrias explicarte mejor ?
  23. GUIEditor = { tab = {}, window = {}, tabpanel = {}, label = {} } function panel() guiVip = guiCreateWindow(345, 157, 423, 207, "VIP Panel", false) guiWindowSetSizable(guiVip, false) tab = guiCreateTabPanel(9, 19, 154, 178, false, guiVip) tab1 = guiCreateTab("Espanol", tab) GUIEditor.label[1] = guiCreateLabel(10, 6, 152, 30, "Recuerda que Todo Vip", false, tab1) GUIEditor.label[2] = guiCreateLabel(10, 26, 152, 30, "Gana 5000$ por Matar", false, tab1) GUIEditor.label[3] = guiCreateLabel(10, 46, 152, 30, "A un objetivo.", false, tab1) GUIEditor.label[4] = guiCreateLabel(5, 66, 107, 25, "Comandos VIP:", false, tab1) guiSetFont(GUIEditor.label[4], "default-small") GUIEditor.label[5] = guiCreateLabel(10, 81, 152, 30, "viped --- Para Abrir Panel", false, tab1) guiSetFont(GUIEditor.label[5], "default-small") GUIEditor.label[6] = guiCreateLabel(10, 101, 152, 30, "Sellvipd --- Para Vender vip", false, tab1) guiSetFont(GUIEditor.label[6], "default-small") GUIEditor.label[7] = guiCreateLabel(10, 131, 152, 30, "Usa un bind para abrir el panel", false, tab1) guiSetFont(GUIEditor.label[7], "default-small") mini = guiCreateButton(174, 36, 83, 41, "Minigun Infinite", false, guiVip) guiSetFont(mini, "default-bold-small") guiSetProperty(mini, "NormalTextColour", "FFAAAAAA") grana = guiCreateButton(174, 87, 83, 41, "Granadas", false, guiVip) guiSetFont(grana, "default-bold-small") guiSetProperty(grana, "NormalTextColour", "FFAAAAAA") m4inf = guiCreateButton(174, 138, 83, 41, "M4 Infinite", false, guiVip) guiSetFont(m4inf, "default-bold-small") guiSetProperty(m4inf, "NormalTextColour", "FFAAAAAA") skin1 = guiCreateButton(277, 36, 83, 41, "Skin 1", false, guiVip) guiSetFont(skin1, "default-bold-small") guiSetProperty(skin1, "NormalTextColour", "FFAAAAAA") skin2 = guiCreateButton(277, 87, 83, 41, "Skin 2", false, guiVip) guiSetFont(skin2, "default-bold-small") guiSetProperty(skin2, "NormalTextColour", "FFAAAAAA") skin3 = guiCreateButton(277, 138, 83, 41, "Skin 3", false, guiVip) guiSetFont(skin3, "default-bold-small") guiSetProperty(skin3, "NormalTextColour", "FFAAAAAA") x = guiCreateButton(389, 179, 24, 18, "x", false, guiVip) guiSetProperty(x, "NormalTextColour", "FFAAAAAA") plata = guiCreateButton(377, 38, 36, 29, "1$", false, guiVip) guiSetProperty(plata, "NormalTextColour", "FFAAAAAA") vida = guiCreateButton(377, 89, 36, 29, "Health", false, guiVip) guiSetFont(vida, "default-small") guiSetProperty(vida, "NormalTextColour", "FFAAAAAA") vendo = guiCreateButton(377, 144, 36, 29, "sell", false, guiVip) guiSetProperty(vendo, "NormalTextColour", "FFAAAAAA") showCursor(true) guiSetVisible(guiVip,false) addEventHandler("onClientGUIClick", x, cierro, false) end addEventHandler("onClientResourceStart", resourceRoot, panel) addEvent("abrirVip",true) function abrirVip() guiSetVisible(guiVip, true) showCursor(true) end addEventHandler("abrirVip", getRootElement(), abrirVip)
  24. local from = get("from") local to = get("to") function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then local accountName = getAccountName ( getPlayerAccount ( killer ) ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "VIP" ) ) ) then local theName = getPlayerName(killer) givePlayerMoney ( killer, 5000) outputChatBox("#FFFF1A[#FFFFFF "..theName.." #FFFF1A]The Vip Has Won 5000 per Kill$" ,root, 255, 255,0,true ) end end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted )
  25. te dejo un post para lo de privatizar el resource de superman solo para admins https://forum.multitheftauto.com/viewtopic.php?f=146&t=75760
×
×
  • Create New...