Search the Community

Showing results for tags 'gui'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Gang


Location


Occupation


Interests

Found 58 results

  1. Thisdp's DirectX Graphical User Interface System ( MTASA 2D+3D DxLIB ) This dxlib provide dx gui functions and events to make it easier to use and alternative to change the style more flexibly. Warning: Old function name like dgsDxGUI*/dgsDx* are no longer supported after 3.4, please change your functions and events name 'dgsDxGUI*'/'dgsDx*' have been changed to 'dgs*' Current Version: 3.37 Final Version: 3.99 Features: 1. Update Check(DGS will notice you if there is a higher version, and you can choose to ignore it or disable it in the config file) Update Command: "updatedgs" 2. Dx GUI Types: Window Edit Box Button Grid List Image Scroll Bar Scroll Pane Text Label Tab Panel Ellipse Detect Area (EDA) Detect Area Radio Button Combo Box Check Box Memo 3D Interface Media Browser Browser 3. Edit Selection Fixed 4. dgs-dxeda is used to check whether your mouse is in the target ellipse area. 5. Debug Mode , Command: "debugdgs" 6. You can apply shader to the dxgui 7. Include CMD, Command: "cmd" ( For more help, please input "help" in the CMD ) 8. Memo rewritten. 9. OOP Class Notice:Do not close your server or stop the script when it is updating. Wiki: https://wiki.multitheftauto.com/wiki/Dgs ( Still Working In Process ) Auto Completion For N++ (Thanks To Ahmed Ly): http://www.mediafire.com/file/m6dm7815d5dihax/lua.zip Discord Server: https://discord.gg/QEs8q6W Download DGS : https://github.com/thisdp/dgs Notice: Need acl rights to call fetchRemote. To Contact Me , Skype: thisdpzjl My server is based on DGS , if you want to see the exact effect of dgs ( not best, my design is bad ). Please have a look. IP: angel.mtaip.cn:10010 If you want to sell your script which involves DGS, please exclude DGS from your price. HurtWorld Backpack Panel(Example) DGS Network Monitor(Built-in)
  2. Grozz

    [SHOW] 3D GUI Library

    I made a 3D GUI System in MTA:SA. You can place 3D GUI Elements (Buttons, Textboxes, Labels, Lists, Checkboxes, Sliders, etc.) wherever you want. It's not public yet.
  3. Hello dudes, I make a circular menu like in gta 5. For this I use dxDrawImage, the menu is divided into 8 pictures. For effect, I hover to change the picture. But the hover area is big. When an empty place is induced. That changes the picture. How to fix it? (Sorry for my English)
  4. mehmet

    What is better CEF or dxDraw?

    Hello, want to make a inventory system. What is better CEF or dxDraw? Say CEF slow performance, but faster development.
  5. xYaroslavGTx

    Не скрывается GUI

    Вечер добрый, столкнулся с тем, что иногда после нажатия кнопки закрытия не исчезает GUI. Мышка скрывается а интерфейс остается. Юзаю вот такой костыль: function atmGUI() atmGUIMain = guiCreateStaticImage(0, 0, screenx, screeny, "atm.png", false) exitGUIbtn = guiCreateStaticImage(screenx/1.1955, screeny/1.367, screenx/20.5, screeny/17, "button.png", false, atmGUIMain) showCursor(true) end addEvent("drawATMgui", true) addEventHandler("drawATMgui", localPlayer,atmGUI) addEventHandler("onClientGUIClick", getRootElement(), function() if(source == exitGUIbtn) then guiSetVisible(atmGUIMain, false) destroyElement(atmGUIMain) showCursor(false) end end ) В основном всё работает как надо, но иногда бывают траблы с закрытием. Подскажите пожалуйста как исправить этот косяк.
  6. knightscript

    Gui Image fade to new image

    Hello, I am trying to make a script that swaps the image on screen for a new one from a table I really am lost and dont have idea what to do next, local screenW, screenH = guiGetScreenSize() local randomize2 = math.random ( #Imagens ) local alpha = 255 local current_image = "" function ImageRender(image,alpha) if getElementData (getLocalPlayer( ),"logedin") == false or getElementData (getLocalPlayer( ),"logedin") == nil then current_image = guiCreateStaticImage(0, 0, screenWidth, screenHeight, tostring(Imagens[image]), false) guiMoveToBack( current_image ) guiSetAlpha(current_image, alpha ) end end addEventHandler("onClientResourceStart", resourceRoot,ImageRender) function RenderImageSwap() if getElementData (getLocalPlayer( ),"logedin") == false or getElementData (getLocalPlayer( ),"logedin") == nil then if (alpha > 0) then newAlpha = alpha < 25 if (newAlpha < 0) then ImageRender(randomize2,255) else ImageRender(current_image,newAlpha) end end end end setTimer( RenderImageSwap, 1000, 0) This is my code right know, which unfortunately, isnt working at all, does anyone know how to make a fade out an image (set alpha to alpha - 25.5 in a duration of 10 seconds for example) and if it reaches zero, it fades the next one in (set alpha of new image to alpha + 25.5 in a duration of 5 seconds for example) thanks I really tried my best but I dont know what functions to use, was thinking on getCurrentTick but I dont get how it works
  7. Hello, I dont know if someone has posted this here before, I searched and wasn´t able to find anyone having this problem, my problem is, I have a DayZ script, which I have been modifying, but since the start some of my players were not able to click on the GUI from the Inventory, nor the gang system, nor the login panel, this just happens with some players, for example, everything works on my computer, but with a virtual machine, I am not able to click on anything, here is a video of what I am talking about, I have no idea why this is caused, there is no related problems in my debugscript, actually, there is only 1 thing that is wrong in my server and been lazy to fix it, just a warning and I am missing an event client side which has nothing to do with this, since it affects various resources, the only way I´ve been able to fix this is by restarting the resource, that seems to fix the issue but I cant restart every time someone logs in: VIDEO: VIDEO (dont know the tags to embed video here) Any help is appreciated
  8. Xwad

    get color from image

    Is it possible to get all the guiStaticImages that have the specified color? I created a few guiStaticImages that are using a fully black png image. i was trying to do it this way, but it does not work.. for i, v in ipairs(getElementType("gui-staticimage")) do local color = guiGetProperty(v, "ImageColours") if color == "000000" then outputChatBox("lol") end end
  9. Hello. (sry for english and stupid question) I created window and input field on DGS win = DGS:dgsDxCreateWindow(0.18, 0.27, 0.22, 0.3," ",true,0xFF000000,25,nil,0xFFFFFFFF,nil,0xFFFFFFFF,5,true) -- window emailBoxReg = DGS:dgsCreateEdit( 0.1, 0.36, 0.8, 0.1, "INPUT FIELD", true, win, 0xFF000000, 0.5, 0.5, nil, 0xFFEBEBEB, false) -- input field DGS:dgsDxGUISetVisible( winReg, true) -- show DGS:dgsDxWindowSetMovable(winReg, false) DGS:dgsDxWindowSetSizable(winReg, false) guiSetInputEnabled(true) -- input showCursor(true) -- cursor why if i click on input field, later click on window - next clicks everywhere not work?
  10. Somehow i can make this possible? When a player connect, then he have to wait the end of download, then he can use the fr gui. I want make fr gui usable when player download the mods. Sorry for my bad english..
  11. Gat

    [Help]DM script

    Hi guys,im stuck here... I want when i press on GUIEditor.button[1] it sends that i typed in GUIEditor.edit[1] to selected player.. --client GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 528) / 2, (screenH - 183) / 2, 528, 183, "dm panel - gat", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(29, 32, 186, 142, false, GUIEditor.window[1]) local column = guiGridListAddColumn(GUIEditor.gridlist[1], "players", 0.9) GUIEditor.button[1] = guiCreateButton(247, 107, 271, 60, "DM", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.edit[1] = guiCreateEdit(247, 32, 269, 65, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(216, 63, 31, 15, "close", false, GUIEditor.window[1]) for id, player in pairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor.gridlist[1]) guiGridListSetItemText ( GUIEditor.gridlist[1], row, column, getPlayerName ( player ), false, false ) guiSetVisible(GUIEditor.window[1], false ) end end ) function show () if guiGetVisible(GUIEditor.window[1] ) then guiSetVisible(GUIEditor.window[1], false ) showCursor (false) else guiSetVisible(GUIEditor.window[1], true ) showCursor (true) end end addCommandHandler("dm", show) function clickin () if source == GUIEditor.label[1] then guiSetVisible(GUIEditor.window[1], false ) showCursor (false) elseif source == GUIEditor.button[1] then if guiGetText(GUIEditor.edit[1] ) == "" then return end --im stoped here, showCursor (false) guiSetVisible(GUIEditor.window[1], false ) end end addEventHandler("onClientGUIClick", root, clickin)
  12. Gat

    [Help]Massaging gui

    I made an script that make staffs can open an panel by using /dm then choose a player and type a message then send it... But my problem is i don't know how to trigger this to put this code in server side outputChatBox(msg, selectedplayer, 255, 255, 255, true) I mean to send the message to selected player only... client variables: msg = guiGetText(editbox) selectedplayer = guiGridListGetSelectedItem(gridlist) Help pls
  13. brocky

    GUI problem [button]

    Hey, I don't know whats wrong in this guy. any ideas? GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(563, 204, 519, 491, "Rules and Regulation", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(9, 29, 500, 418, "", false, GUIEditor.window[1]) button1 = guiCreateButton(18, 449, 491, 32, "I agree", false, GUIEditor.window[1]) end ) function closeButton() if button1 == source then outputChatBox("Hey") end end addEventHandler("onClientGUIClick",button1,closeButton,false)
  14. LPM//Bruno

    Problema con TabPanel en FR

    Buenas a todos, estoy armando una sección de Mi Cuenta en mi servidor, quiero que sea una ventanita con un tabpanel que tenga las siguientes pestañas: Inicio (donde muestra las estadisticas basicas, nombre, tipo de cuenta, nivel, etc) Configuración (donde mostrara botones para cambiar la clave, eliminar la cuenta, etc) Clan (donde mostraria datos exportados del gangystem) Por ahora no se me ocurre ninguna otra solapa, si alguno le ve alguna utilidad a una solapa podría recomendármela también El problema es el siguiente, estoy creando esto a través de la GUI del resource freeroam (ya que el botón de Mi Cuenta está en el freeroam también, entonces quería hacer todo junto). El código es el siguiente: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, }, } Y el resultado el siguiente: Es extraño, pero digo... quizá le faltan las tab para que funcione, entonces la agrego y el codigo queda así: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, {'tab', id='tab1', text='pruebaTab', width=200 , height=200}, }, } Pero el resultado es que cuando quiero abrir esta sección (Mi Cuenta) muestra los ultimos 2 errores en el debugscript (ignoren el de callesgroove) Alguien podría ayudarme? Desde ya, muchas gracias!
  15. LPM//Bruno

    Problem with TabPanel on FR

    Hi all, I'm putting together a section of My Account on my server, I want it to be a little window with a tabpanel that has the following tabs: Start (where it shows the basic statistics, name, type of account, level, etc) Configuration (where it will show buttons to change the password, delete the account, etc) Clan/Gang (where it would show data exported from the gangystem) For now I can not think of any other flap, if any one sees a utility to a flap I could also recommend it The problem is this, I am creating this through the freeroam resource GUI (since the My Account button is in the freeroam too, then I wanted to do everything together). The code is the following: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, }, } The result: It's strange, but I say ... maybe the tab is missing for it to work, so I add it and the code looks like this: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, {'tab', id='tab1', text='pruebaTab', width=200 , height=200}, }, } But the result is that when I want to open this section (My Account) it shows the last 2 errors in the debugscript (ignore 'callesgroove' resource) Somebody could help me? From already thank you very much!
  16. Bonsai

    Transparent Editbox

    Hi, is there already a way to make the default gui editboxes transparent? It seems to always have a white background, which doesn't look so good if they are used within a dx environment. If not, then this might be a good way to make the default editboxes usable outside of an actual gui window. @ccw Bonsai
  17. xYaroslavGTx

    GUI dynamic size problems

    Hi all, could you tell me how to make a dynamic installation of interface sizes depending on the size of the user's screen? Code: function guiCreateMainMenu() local sWidth,sHeight = guiGetScreenSize() local localPlayerName = getPlayerName(getLocalPlayer()) mainMenuSound() menu = guiCreateStaticImage( 0, 0, sWidth, sHeight, "img/screen_shadow.png", false ) userImg = guiCreateStaticImage( sWidth/2.8, 0, sWidth/1.5, sHeight/1.5, "img/user.png", false, menu ) menuBg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/bg.png", false, menu ) menuFg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/fg.png", false, menu ) usernameLabel = guiCreateLabel( sWidth/2434.78260, sHeight/14000, 1, 1, localPlayerName, true, userImg) --24 символа макс. userNameFont = guiCreateFont( "fonts/calibri.ttf", 16 ) guiSetFont ( usernameLabel, userNameFont ) menuMainLabel = guiCreateLabel( sWidth/8400, sHeight/11666.66666, 1, 1, "*Главное меню*", true, menu) mainMenuFont = guiCreateFont( "fonts/carbon.ttf", 32 ) guiSetFont ( menuMainLabel, mainMenuFont ) carrierBtn = guiCreateLabel( (0.12/1680)*sWidth, 0.341, 1, 1, "КАРЬЕРА", true, menuFg) carrierBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( carrierBtn, carrierBtnFont ) carrierButton = guiCreateStaticImage( 385, 154, 80, 13, "img/btn.png", false, menu ) statBtn = guiCreateLabel( 0.2, 0.341, 1, 1, "СТАТИСТИКА", true, menuFg) statBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( statBtn, statBtnFont ) statButton = guiCreateStaticImage( 481, 154, 111, 13, "img/btn.png", false, menu ) achBtn = guiCreateLabel( 0.313, 0.341, 1, 1, "ДОСТИЖЕНИЯ", true, menuFg) achBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( achBtn, achBtnFont ) achButton = guiCreateStaticImage( 615, 154, 121, 13, "img/btn.png", false, menu ) bestBtn = guiCreateLabel( 0.432, 0.341, 1, 1, "ТОП ЛУЧШИХ ИГРОКОВ", true, menuFg) bestBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( bestBtn, bestBtnFont ) bestButton = guiCreateStaticImage( 758, 154, 198, 13, "img/btn.png", false, menu ) settingsBtn = guiCreateLabel( 0.616, 0.341, 1, 1, "НАСТРОЙКИ", true, menuFg) settingsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( settingsBtn, settingsBtnFont ) settingsButton = guiCreateStaticImage( 980, 154, 101, 13, "img/btn.png", false, menu ) newsBtn = guiCreateLabel( 0.720, 0.341, 1, 1, "НОВОСТИ", true, menuFg) newsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( newsBtn, newsBtnFont ) newsButton = guiCreateStaticImage( 1106, 154, 78, 13, "img/btn.png", false, menu ) aboutBtn = guiCreateLabel( 0.810, 0.341, 1, 1, "О СЕРВЕРЕ", true, menuFg) aboutBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( aboutBtn, aboutBtnFont ) aboutButton = guiCreateStaticImage( 1213, 154, 87, 13, "img/btn.png", false, menu ) showCursor(true) showChat(false) setPlayerHudComponentVisible("all", false) end
  18. Доброго времени суток. Столкнулся с такой проблемой как динамическое изменение размеров интерфейса под разрешение экрана игрока. Я накидал GUI под своё разрешение экрана т.е. в таком виде: guiCreateLabel( 0.2, 0.341, 1, 1, "СТАТИСТИКА", true, menuFg) statBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( statBtn, statBtnFont ) Вообще это всё выглядит вот так: Скриншот Код клиента целиком: function guiCreateMainMenu() local sWidth,sHeight = guiGetScreenSize() local localPlayerName = getPlayerName(getLocalPlayer()) mainMenuSound() menu = guiCreateStaticImage( 0, 0, sWidth, sHeight, "img/screen_shadow.png", false ) userImg = guiCreateStaticImage( sWidth/2.8, 0, sWidth/1.5, sHeight/1.5, "img/user.png", false, menu ) menuBg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/bg.png", false, menu ) menuFg = guiCreateStaticImage( sWidth/7, sHeight/8.07692, sWidth/1.4, sHeight/17, "img/fg.png", false, menu ) usernameLabel = guiCreateLabel( sWidth/2434.78260, sHeight/14000, 1, 1, localPlayerName, true, userImg) --24 символа макс. userNameFont = guiCreateFont( "fonts/calibri.ttf", 16 ) guiSetFont ( usernameLabel, userNameFont ) menuMainLabel = guiCreateLabel( sWidth/8400, sHeight/11666.66666, 1, 1, "*Главное меню*", true, menu) mainMenuFont = guiCreateFont( "fonts/carbon.ttf", 32 ) guiSetFont ( menuMainLabel, mainMenuFont ) carrierBtn = guiCreateLabel( (0.12/1680)*sWidth, 0.341, 1, 1, "КАРЬЕРА", true, menuFg) carrierBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( carrierBtn, carrierBtnFont ) carrierButton = guiCreateStaticImage( 385, 154, 80, 13, "img/btn.png", false, menu ) statBtn = guiCreateLabel( 0.2, 0.341, 1, 1, "СТАТИСТИКА", true, menuFg) statBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( statBtn, statBtnFont ) statButton = guiCreateStaticImage( 481, 154, 111, 13, "img/btn.png", false, menu ) achBtn = guiCreateLabel( 0.313, 0.341, 1, 1, "ДОСТИЖЕНИЯ", true, menuFg) achBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( achBtn, achBtnFont ) achButton = guiCreateStaticImage( 615, 154, 121, 13, "img/btn.png", false, menu ) bestBtn = guiCreateLabel( 0.432, 0.341, 1, 1, "ТОП ЛУЧШИХ ИГРОКОВ", true, menuFg) bestBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( bestBtn, bestBtnFont ) bestButton = guiCreateStaticImage( 758, 154, 198, 13, "img/btn.png", false, menu ) settingsBtn = guiCreateLabel( 0.616, 0.341, 1, 1, "НАСТРОЙКИ", true, menuFg) settingsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( settingsBtn, settingsBtnFont ) settingsButton = guiCreateStaticImage( 980, 154, 101, 13, "img/btn.png", false, menu ) newsBtn = guiCreateLabel( 0.720, 0.341, 1, 1, "НОВОСТИ", true, menuFg) newsBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( newsBtn, newsBtnFont ) newsButton = guiCreateStaticImage( 1106, 154, 78, 13, "img/btn.png", false, menu ) aboutBtn = guiCreateLabel( 0.810, 0.341, 1, 1, "О СЕРВЕРЕ", true, menuFg) aboutBtnFont = guiCreateFont( "fonts/calibri.ttf", 15 ) guiSetFont ( aboutBtn, aboutBtnFont ) aboutButton = guiCreateStaticImage( 1213, 154, 87, 13, "img/btn.png", false, menu ) showCursor(true) showChat(false) setPlayerHudComponentVisible("all", false) end P.S. В начале уже пытался поправить эту проблему, но получилось мягко говоря не очень. Подскажите пожалуйста как оптимизировать меню без танцев с подбором новых значений?
  19. After I finished the first version of my character customization system i just realized its such a piece of crap, so i started writing a new version with a whole new concept. The first version worked with CJ skin and i just attached some custom head models to it. Conversely the new version is running with shaders and the skin is a custom dff. Here is a video of the head customization. The clothing is in progress yet, it takes a lot of time because i have to make custom cloth models. Hope you like it. Please don't ask for the source code, this script will never be released. Sorry.
  20. I would apperciate it very much if you could give some advice on DGS.
  21. KOTRM(&

    The gui window is not opening

    Hello in this script the gui window is not opening in my server. before it was opening but the object is not moving and i had updated some things and then the gui is not opening Please fix the problem SERVER: --Creating Of The Parts local hull1 = createObject(1680, 139.78, -1919.66, 17.07, 0, 0, 180) --Hull1 local sail1 = createObject(1683, 140.56, -1912.22, 20.16, 0, 0, 180) --Sails1 --Attachments Of The Parts attachElements(sail1, hull1, 0, 0, 0) function GUIness(source) local taccount = getPlayerAccount ( source ) if isAdminAccount(taccount) then triggerClientEvent(source, "makeGUI1", root) end end addCommandHandler("balloon", GUIness) --Command for opening GUI function goToballoon(source) local taccount = getPlayerAccount(source) if isAdminAccount(taccount) then local x,y,z = getElementPosition(hull1) setElementPosition(source, x, y + 5, z - 9) end end addCommandHandler("gotoballoon", goToballoon) --Command for warping to the balloon function setballoonHeightFunc(playerSource, commandName, height) if (height) then local taccount = getPlayerAccount(source) if isAdminAccount(taccount) then local x,y,z = getElementPosition(hull1) setElementPosition(hull1, x, y, tonumber(height)) end end end addCommandHandler("balloonheight", setballoonHeightFunc) function stopballoonFunc() stopObject(hull1) end addEvent("stopballoon", true) addEventHandler("stopballoon", root, stopballoonFunc) --balloon Ship Raise/Lower/Reset function balloonHeightFunc(theValue) local x,y,z = getElementPosition(hull1) if theValue == 17 then moveObject(hull1, 0, x, y, 17) else moveObject(hull1, 5000, x, y, z + theValue) end end addEvent("balloonHeight", true) addEventHandler("balloonHeight", root, balloonHeightFunc) --balloon Ship Warper function balloonWarper(x, y, z, rx, ry, rz) moveObject(hull1, 0, x, y, z, rx, ry, rz) end addEvent("moveToBut1", true) addEventHandler("moveToBut1", root, balloonWarper) --Directional Movement Controls function balloonMove(xD, yD, zD) local x,y,z = getElementPosition(hull1) moveObject(hull1, 20000000, x + xD, y + yD, z + zD) end addEvent("balloonMoveEvent", true) addEventHandler("balloonMoveEvent", root, balloonMove) --Rotational Movement Controls function balloonRotateFunc(rX, rY, rZ) local x,y,z = getElementPosition(hull1) moveObject(hull1, 5000, x, y, z, rX, rY, rZ) end addEvent("balloonRotate", true) addEventHandler("balloonRotate", root, balloonRotateFunc) --Stop Bind function BindM() if (not isKeyBound(source, "m")) then bindKey(source, "m", "down", createM) end end addEventHandler("onPlayerSpawn", getRootElement(), BindM) function createM(player, commandName) local account = getPlayerAccount(player) if isAdminAccount(account) then stopObject(hull1) end end addCommandHandler("m", createM) function isAdminAccount(account) local nick = "" local group = aclGetGroup("Admin") if (account and group) then nick = string.lower(getAccountName(account) or "") for _, object in ipairs(aclGroupListObjects(group) or {}) do if (gettok(object, 1, string.byte('.')) == "user") then if (nick == string.lower(gettok(object, 2, string.byte('.')))) then return true end end end end return false end CLIENT: local resX, resY = guiGetScreenSize() function createGUI(thePlayer) cWindow = guiCreateWindow((resX/2)-315,(resY/2)-100,629,200,"Balloon Controls",false) buttonSAC = guiCreateButton(0.3418,0.485,0.0668,0.195,"Stop",true,cWindow) NW = guiCreateButton(0.2655,0.255,0.0668,0.195,"NW",true,cWindow) N = guiCreateButton(0.3418,0.255,0.0668,0.195,"N",true,cWindow) NE = guiCreateButton(0.4213,0.26,0.0668,0.195,"NE",true,cWindow) W = guiCreateButton(0.2671,0.485,0.0668,0.195,"W",true,cWindow) E = guiCreateButton(0.4213,0.49,0.0668,0.195,"E",true,cWindow) SW = guiCreateButton(0.2671,0.73,0.0668,0.195,"SW",true,cWindow) S = guiCreateButton(0.3434,0.73,0.0668,0.195,"S",true,cWindow) SE = guiCreateButton(0.4213,0.725,0.0668,0.195,"SE",true,cWindow) NWr = guiCreateButton(0.5119,0.26,0.0668,0.195,"45",true,cWindow) GoUp = guiCreateButton(0.5919,0.26,0.0668,0.195,"Up",true,cWindow) resetH = guiCreateButton(0.6750,0.12,0.0600,0.1,"Reset",true,cWindow) NEr = guiCreateButton(0.6693,0.26,0.0668,0.195,"45",true,cWindow) Wr = guiCreateButton(0.5119,0.49,0.0668,0.195,"90",true,cWindow) GoDn = guiCreateButton(0.5919,0.49,0.0668,0.195,"Down",true,cWindow) Er = guiCreateButton(0.6693,0.495,0.0668,0.195,"90",true,cWindow) button1 = guiCreateButton(0.7663,0.26,0.213,0.150,"Move To LS",true,cWindow) button2 = guiCreateButton(0.7663,0.440,0.213,0.150,"Move To SF",true,cWindow) button3 = guiCreateButton(0.7663,0.620,0.213,0.150,"Move To LV",true,cWindow) button4 = guiCreateButton(0.5175,0.725,0.213,0.195,"Close",true,cWindow) TiltUp = guiCreateButton(0.0143,0.49,0.1113,0.195,"Tilt Up",true,cWindow) TiltDown = guiCreateButton(0.0143,0.72,0.1113,0.195,"Tilt Down",true,cWindow) TiltRight = guiCreateButton(0.1430,0.49,0.1113,0.195,"Tilt Right",true,cWindow) TiltLeft = guiCreateButton(0.1430,0.72,0.1113,0.195,"Tilt Left",true,cWindow) GUIEditor_Label1 = guiCreateLabel(0.2766,0.125,0.2051,0.075, "Movement Controls",true,cWindow) guiLabelSetColor(GUIEditor_Label1,255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label1,"top") guiLabelSetHorizontalAlign(GUIEditor_Label1,"left",false) GUIEditor_Label2 = guiCreateLabel(0.5158,0.125,0.1781,0.08,"Rotation Controls",true,cWindow) guiLabelSetColor(GUIEditor_Label2,255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label2,"top") guiLabelSetHorizontalAlign(GUIEditor_Label2,"left",false) GUIEditor_Label3 = guiCreateLabel(0.806,0.125,0.1669,0.0739,"Warp Controls",true,cWindow) guiLabelSetColor(GUIEditor_Label3,255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label3,"top") guiLabelSetHorizontalAlign(GUIEditor_Label3,"left",false) GUIEditor_Label4 = guiCreateLabel(0.0525,0.135,0.1669,0.0739,"Tilt Controls",true,cWindow) guiLabelSetColor(GUIEditor_Label4,255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label4,"top") guiLabelSetHorizontalAlign(GUIEditor_Label4,"left",false) addEventHandler("onClientGUIClick", GoUp, function() triggerServerEvent("balloonHeight", root, 3) end, false) addEventHandler("onClientGUIClick", GoDn, function() triggerServerEvent("balloonHeight", root, -3) end, false) addEventHandler("onClientGUIClick", resetH, function() triggerServerEvent("balloonHeight", root, 17) end, false) addEventHandler("onClientGUIClick", buttonSAC, function() triggerServerEvent("stopballoon", root) end, false) addEventHandler("onClientGUIClick", button1, function() triggerServerEvent("moveToBut1", root, 139.78, -1919.66, 17.07, 0, 0, 0) end, false) addEventHandler("onClientGUIClick", button2, function() triggerServerEvent("moveToBut1", root, -1716.25, 1457.45, 17.07, 0, 0, 0) end, false) addEventHandler("onClientGUIClick", button3, function() triggerServerEvent("moveToBut1", root, 2289.28, 516.86, 17.07, 0, 0, 90) end, false) addEventHandler("onClientGUIClick", button4, closeCgui, false) addEventHandler("onClientGUIClick", NW, function() triggerServerEvent("balloonMoveEvent", root, -9999, 9999, 0) end, false) addEventHandler("onClientGUIClick", N, function() triggerServerEvent("balloonMoveEvent", root, 0, 9999, 0) end, false) addEventHandler("onClientGUIClick", NE, function() triggerServerEvent("balloonMoveEvent", root, 9999, 9999, 0) end, false) addEventHandler("onClientGUIClick", E, function() triggerServerEvent("balloonMoveEvent", root, 9999, 0, 0) end, false) addEventHandler("onClientGUIClick", SE, function() triggerServerEvent("balloonMoveEvent", root, 9999, -9999, 0) end, false) addEventHandler("onClientGUIClick", S, function() triggerServerEvent("balloonMoveEvent", root, 0, -9999, 0) end, false) addEventHandler("onClientGUIClick", SW, function() triggerServerEvent("balloonMoveEvent", root, -9999, -9999, 0) end, false) addEventHandler("onClientGUIClick", W, function() triggerServerEvent("balloonMoveEvent", root, -9999, 0, 0) end, false) addEventHandler("onClientGUIClick", NWr, function() triggerServerEvent("balloonRotate", root, 0, 0, 45) end, false) addEventHandler("onClientGUIClick", NEr, function() triggerServerEvent("balloonRotate", root, 0, 0, -45) end, false) addEventHandler("onClientGUIClick", Er, function() triggerServerEvent("balloonRotate", root, 0, 0, -90) end, false) addEventHandler("onClientGUIClick", Wr, function() triggerServerEvent("balloonRotate", root, 0, 0, 90) end, false) addEventHandler("onClientGUIClick", TiltUp, function() triggerServerEvent("balloonRotate", root, 3, 0, 0) end, false) addEventHandler("onClientGUIClick", TiltDown, function() triggerServerEvent("balloonRotate", root, -3, 0, 0) end, false) addEventHandler("onClientGUIClick", TiltRight, function() triggerServerEvent("balloonRotate", root, 0, 3, 0) end, false) addEventHandler("onClientGUIClick", TiltLeft, function() triggerServerEvent("balloonRotate", root, 0, -3, 0) end, false) guiSetVisible (cWindow, false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),createGUI) function openGUI(thePlayer) if (cWindow ~= nil) then guiSetVisible(cWindow, true) showCursor(true) end end
  22. Tudo bem com vocês? Bem vou direto ao assunto gostaria de sabe como faço para adiciona o Player do tal TIME q criei. Exemplo quando eu aperta do button vai adicionar ele do Time lenhador ai quando ele desloga vai tira ele do Time. Bom obrigado a quem me ajuda function Lenhador () LenhadorTeam = createTeam ( "Lenhador", 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot, Lenhador)
  23. carlos eduardo

    Por Favor me ajudem(sou novato)

    Por favor me ajudem eu tou com um problema com um arquivo GUI. Eu vi um tutorial na Wikipédia do MTA, fiz tudo direitinho conforme foi ensinado. Até que eu terminei o script, e fui iniciar o server para ver se ele estava funcionando direito. Quando percebi tinha acontecido certo erro: [18:20:45] ERROR: Couldn't find script client/gui.lua for resource client [18:20:45] Loading of resource 'client' failed se precisarem do script: O do gui.lua: e o do script.lua: por favor se poderem me ajudar
  24. Hi guys, I'm realtive new into scripting and as far as I know, I like it alot Right now I'm working on a simple but useless script that querys a MySQL Database to get a list of serials (random) then using a GUI Window with a gridList the user is able to see the table I have add a function to only make the system work for Admin Users It works like this The client side contains the GUI, when the user wants to open the panel, I added an CommandHandler that goes to a function that verify if the source is an admin, if it is, it triggers an ClientEvent that creates and display the GUI Then there is a button on the GUI that when it is clicked it triggers an Server Event that querys the Database and Triggers an Client Event to send the table with the information, then just using a for I fill the table of the grid list My Question -How secure it is ? can I get Hacked by the way my script is coded? -Any recomendation of how can I make it better? Thanks! Here is the code Client.lua --Function to create the GUI function createGUI() --Create the window window = guiCreateWindow(374, 221, 1181, 647, "Script", false) guiWindowSetSizable(window, false) Grid = guiCreateGridList(12, 52, 257, 408, false, window) QueryB = guiCreateButton(12, 465, 257, 37, "QUERY", false, window) Colum = guiGridListAddColumn( Grid, "Serial", 1.0 ) ExitB = guiCreateButton(466, 596, 249, 41, "Exit", false, Window) --Add event handler when the exit button is presed addEventHandler("onClientGUIClick", ExitB, closeGUI, false ) --Add event handler when the query button is presed addEventHandler("onClientGUIClick", QueryB, function() triggerServerEvent("sendMeTheData",resourceRoot) --This triggers the server Event that triggers a client event with the table end , false ) end --Function to start the GUI function startGUI() --Create GUI createGUI() --If everything is fime then set it to visible if (window ~= nil) then guiSetVisible(window, true) else outputChatBox("error") end --show cursor showCursor(true) guiSetInputEnabled(true) end --Function to close GUI function closeGUI() --hide the GUI guiSetVisible(Window, false) showCursor(false) guiSetInputEnabled(false) end --Function to fill the grid list row function fillRow(table) guiGridListClear(Grid) --clear the grid list --using for, fill the grid with the table for k, data in ipairs(table) do local row = guiGridListAddRow ( Grid ) guiGridListSetItemText ( Grid, row, Colum, data.serial , false , false ) --add item to row end end --Events and Event Handler addEvent("fillData",true) addEventHandler("fillData",getRootElement(),fillRow) addEvent("showGUI",true) addEventHandler("showGUI",getRootElement(),startGUI) Server.lua --MySQL data local host = "x.x.x.x" local user = "user" local password = "password" local database = "database" --Connect to mysql server local conexion = dbConnect( "mysql", "dbname="..database..";host="..host,user,password, "share=1") --Function to show the GUI function showPanel(player,cmd) --see if the player is admin if (isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))) then --trigger client event to open the GUI triggerClientEvent(player,"showGUI",player) else outputChatBox("Sorry, you are not admin!",source) end end --Function to query mysql database and trigger client function to send table function getOnlyRow(tipo) local query = dbQuery(conexion,"SELECT * FROM log") local table = dbPoll(query,-1) --Trigger client event to fill grid list triggerClientEvent(client,"fillData",client,table) end --Event and event handler addEvent("sendMeTheData",true) addEventHandler("sendMeTheData",getResourceRootElement(),getTable) addCommandHandler("panel",showPanel)
  25. السلام عليكم ورحمة الله وبركاتة كيف حال الشباب ان شاء الله طيبين اليوم انا طالب شي منكم شوفو في جدول تختار منو خاصية للوحة المساعدة اما تختار supports offline help طبعاً في جريد ليست للاعبين الي بسيرفر تختار لاعب وتدوس زر تغير تجيه الحالة الي اخترتها من فوق بس الكود في خطأ والدي بق ما يطلع شي Help Me Please addEventHandler("onClientGUIClick", resourceRoot, function() if source == Change and guiComboBoxGetSelected(StatBox) ~= -1 then local Stat = guiComboBoxGetItemText(StatBox, guiComboBoxGetSelected(StatBox)) local playerName = guiGridListGetItemText(PlayersGridList, guiGridListGetSelectedItem(PlayersGridList), 1) triggerServerEvent("SupportSystem:adminSetStat", localPlayer, getPlayerFromName(playerName), Stat) refreshSupportList() end end ) function refreshSupportList() guiGridListClear(SupportList) for _,players in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(SupportList) if getElementData(players, "stat") == "support" then guiGridListSetItemText(SupportList, row, 1, getPlayerName(players), false, false) guiGridListSetItemColor(SupportList, row, 1, 0, 255, 0) end end end --- # server Code addEvent("SupportSystem:adminSetStat", true) addEventHandler("SupportSystem:adminSetStat", root, function(player, Stat) setElementData(player, "stat", Stat) exports["guimessages"]:outputServer(player, "#FFFFFF[ #e1e1e1Support Chat #FFFFFF] : #00ff00"..getPlayerName(source).." has changed your support states to #ff0000"..Stat) exports["guimessages"]:outputServer(player, "#FFFFFF[ #e1e1e1Support Chat #FFFFFF] : #00ff00"..getPlayerName(player).." states changed to #ff0000"..Stat) sendMessageToLogs(getPlayerName(source).." changed "..getPlayerName(player).." support states to "..Stat) end)