Jump to content

Search the Community

Showing results for tags 'gui'.

  • 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
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • 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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. 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!
  2. 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
  3. 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
  4. Доброго времени суток. Столкнулся с такой проблемой как динамическое изменение размеров интерфейса под разрешение экрана игрока. Я накидал 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. В начале уже пытался поправить эту проблему, но получилось мягко говоря не очень. Подскажите пожалуйста как оптимизировать меню без танцев с подбором новых значений?
  5. I would apperciate it very much if you could give some advice on DGS.
  6. 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
  7. 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)
  8. 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
  9. 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)
  10. السلام عليكم ورحمة الله وبركاتة كيف حال الشباب ان شاء الله طيبين اليوم انا طالب شي منكم شوفو في جدول تختار منو خاصية للوحة المساعدة اما تختار 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)
  11. Hello, I'm using gridlist sections for weapon classes. I have stored my weapon data in table and i have set each weapon it's own class. So my problem is this: It creates section for every weapon, but it should skip if there is already section for class. Here's how it looks now and how it should not look: Code: [Table]: prices = { { name="Shotgun", id=25, ammo=30, price=700, class="Shotguns", type="everyone" }; { name="Sawed-off", id=26, ammo=30, price=650, class="Shotguns", type="everyone" }; { name="Combat Shotgun", id=27, ammo=30, price=800, class="Shotguns", type="everyone" }; { name="Uzi", id=28, ammo=60, price=500, class="Sub-Machine Guns", type="everyone" }; { name="MP5", id=29, ammo=60, price=600, class="Sub-Machine Guns", type="everyone" }; { name="Uzi", id=32, ammo=60, price=500, class="Sub-Machine Guns", type="everyone" }; { name="AK-47", id=30, ammo=60, price=800, class="Assault Rifles", type="everyone" }; { name="M4", id=31, ammo=60, price=1000, class="Assault Rifles", type="everyone" }; { name="Rifle", id=33, ammo=60, price=2000, class="Rifles", type="everyone" }; { name="Sniper", id=34, ammo=60, price=3000, class="Rifles", type="everyone" }; { name="Rocket Launcher", id=35, ammo=20, price=7000, class="Heavy Weapons", type="Vip" }; { name="Heat-Seeking Rocket Launcher", id=36, ammo=20, price=1000, class="Heavy Weapons", type="Vip" }; { name="Minigun", id=38, ammo=2000, price=10000, class="Heavy Weapons", type="Vip" }; } [Client]: function drawWeaponsTable(weapons, isVip, vip_discount) local weapons = fromJSON(weapons) guiGridListClear(gridlist) local t = {} for i=1, #weapons do local value = weapons[i]["class"] if t[value] == nil then table.insert(t, value) local row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, row, 1, value, true, false) end local row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, row, 1, weapons[i]["name"], false, false) end end Hope you understand something
  12. https://luca-spopo.github.io/ash.html Made using bakaGaijin. I am not going to type everything here again, so just click the first link on top. Some teasers: https://youtu.be/qGYF3OFbGy8 https://youtu.be/pVPMER9JTiI https://youtu.be/Hm0xIc35BfA Before you ask: No, this does not use Javascript or CEF. It is a pure Lua implementation.
  13. How can i focus gui-edit with a function?
  14. Hello I have, going to do a ranking of players where considered to be, and their quantity. The entry points I made to the MySQL database, there is written the number of points, the player and continuously updated. 3D GUI also I have done, I give the code below. I would like to make in this GUI was displayed ranking 10 or 5 players with the most points. I have no idea how I make such a ranking. This is beyond my skills. Here is the code for 3D GUI: local renderTarget = dxCreateRenderTarget(1000, 1000, true) local X, Y, Z = -345.5341796875, -1031.6298828125, 59.296432495117 local title_font = dxCreateFont(":server_fonts/main_font.ttf", 63) local ranking_font = dxCreateFont(":server_fonts/main_font.ttf", 50) addEventHandler("onClientRender", root, function() dxSetRenderTarget(renderTarget, true) dxDrawRectangle( 0, 0, 1000, 700, tocolor(72, 71, 81, 190)) -- Background dxDrawText("Job Ranking", 0, 0, 1000, 100, tocolor(255, 255, 255, 255), 1, title_font, "center", "center") -- Text dxDrawText("1. ", -830, 300, 1000, 50, tocolor(255, 255, 255, 255), 1, ranking_font, "center", "center") -- Text dxSetRenderTarget() dxDrawMaterialLine3D( X, Y, Z + 5, X, Y, Z, renderTarget, 5, tocolor(255, 255, 255, 255), -2000, 0, 0) end)
  15. MrDadosz

    MTA GUI crashing

    Hello. One of our players has crashes when server shows GUI for him. He updated MTA to newest nightly, reinstalled game, MTADiag: https://pastebin.mtasa.com/313816765 Video:
  16. Buenas tardes, me podrían ayudar a cómo hacer para solucionar el siguiente problema, cuando realizo un panel y creo un Edit Box, al intentar ingresar texto en el Edit Box existe problemas con las teclas que tienen bind, por ejemplo con la t(para el say) o p(para el panel de admin). Este es el código de un ejemplo simple (Client): function asd() Panel = guiCreateWindow(216, 166, 942, 231, "", false) guiWindowSetSizable(Panel, false) Ingreso = guiCreateEdit(51, 41, 858, 68, "", false, Panel) showCursor (true) end addCommandHandler ("cp", asd) Aquí las SS del problema con la "t": http://prntscr.com/gw9g0z http://prntscr.com/gw9gp2 lo mismo pasa al presionar la "p" mientras se escribe en el Editbox: http://prntscr.com/gw9h3t ¿Cómo puedo hacer que sin importar la tecla que presione el bin de esa no se active del mismo modo que este ejemplo? http://prntscr.com/gw9hlm
  17. hello i need a help in creating a guibutton in freeroampanel, same like jetpack and fall of bike option! code is working fine but i need to add it has gui in freeroam panel here is the code; function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then if isPedDead(source) then spawnMe() end end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox('No free seats left in ' .. getPlayerName(targetPlayer) .. '\'s vehicle.', source, 255, 0, 0) end local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end any suggest please??
  18. i downloaded a jail script from community, and when i add me to a jail, i can access the F1 how to disable fr gui in jail? server: Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) anims = { "F_smklean_loop", "M_smklean_loop", "M_smkstnd_loop", "M_smk_drag", "M_smk_in", "M_smk_loop", "M_smk_out", "M_smk_tap" , } function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("** #FFFF00You Jailed [ "..getPlayerName(thePlayer).." #FFFF00] at "..theJail[1].." For "..time,source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Jailed By [ "..getPlayerName(source).." #FFFF00] at "..theJail[1].." For "..time,thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Jailed For "..time,root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Please Select Time !",source,255,0,0,true) end else outputChatBox("** #FFFF00Please Select a Jail !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00You Released [ "..getPlayerName(thePlayer).." #FFFF00]",source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Released by [ "..getPlayerName(source).." #FFFF00]",thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Released ",root,255,0,0,true) setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Time Left : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimer:~(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ :p function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimer:~(plr,timer,time) -- to sort timer's :~ .. if timer and time then if isTimer(timer:~Timer) then killTimer(timer:~Timer) end timer:~Timer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then textDestroyTextItem(TimerText) end if isTimer(timer:~Timer) then killTimer(timer:~Timer) end end function onTimerFinish(Player) -- on timer end stopJailTimer(Player) triggerEvent("onJailEnd",Player,Player) end client: lp = getLocalPlayer() rRoot = getResourceRootElement(getThisResource()) setElementData(lp,"jailed",false) ------ addEventHandler("onClientResourceStart",rRoot,function() triggerServerEvent("getDataz",lp,lp) end ) desz = {} addEvent("sendDataz",true) addEventHandler("sendDataz",root,function(jTable,tTable) ------ jWin = guiCreateWindow(460,172,445,416,"Jail System v2.1",false) --- Center Window --- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(jWin,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(jWin,x,y,false) ----- Center Window ----- guiSetVisible(jWin,false) guiWindowSetSizable(jWin,false) ------------------------- jBut = guiCreateButton(247,338,167,31,"Jail Him",false,jWin) tGrid = guiCreateGridList(240,184,190,144,false,jWin) guiGridListSetSelectionMode(tGrid,0) ------- -- sEdit = guiCreateEdit(14,380,217,23,"Search ..",false,jWin) -- -------- local timeC = guiGridListAddColumn( tGrid, "Time", 0.85 ) if timeC then for k,v in ipairs ( tTable ) do local time = v[1] local des = v[2] local row = guiGridListAddRow ( tGrid ) desz[row] = des guiGridListSetItemText ( tGrid, row, timeC, time.." "..des, false, true ) end local row = guiGridListAddRow ( tGrid ) guiGridListSetItemText ( tGrid, row, timeC,"Other ..", false, true ) end -------- jGrid = guiCreateGridList(240,31,190,144,false,jWin) guiGridListSetSelectionMode(jGrid,0) -------- local jailC = guiGridListAddColumn( jGrid, "Jail", 0.85 ) for k,v in ipairs ( jTable ) do local name = v[1] local row = guiGridListAddRow ( jGrid ) guiGridListSetItemText ( jGrid, row, jailC, name, false, false ) end jcBut = guiCreateButton(246,378,172,24,"Close",false,jWin) function jailShow () guiSetVisible(jWin,not guiGetVisible ( jWin ) ) showCursor(guiGetVisible ( jWin ) ) guiSetInputEnabled(guiGetVisible ( jWin ) ) destroyElement(pList) -- Players List pList = guiCreateGridList(14,31,218,338,false,jWin) column = guiGridListAddColumn( pList, "Player", 0.85 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end -- Players List end addEvent("jailShow",true) addEventHandler("jailShow",root,jailShow) function changeText(button,state,x,y) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) local thePlr = getPlayerFromName(sPlayer) if thePlr then local isJailed = getElementData(thePlr,"jailed") if isJailed == false then guiSetText(jBut,"Jail Him") elseif isJailed == true then guiSetText(jBut,"Release Him") end end end addEventHandler("onClientGUIClick",root,changeText) function onClick (button, state, absoluteX, absoluteY) selectedRow, selectedCol = guiGridListGetSelectedItem( pList ) sPlayer = guiGridListGetItemText( pList, selectedRow, selectedCol ) jail = guiGridListGetItemText ( jGrid, guiGridListGetSelectedItem ( jGrid ), 1 ) time = guiGridListGetItemText ( tGrid, guiGridListGetSelectedItem ( tGrid ), 1 ) timeDes = tostring(desz[guiGridListGetSelectedItem ( tGrid )]) if ( source == jBut ) then if guiGetText(jBut) == "Jail Him" then if time ~= "Other .." then triggerServerEvent("JailHimx",lp,sPlayer,jail,time,timeDes) else createTimeSelect(sPlayer,jail) end elseif guiGetText(jBut) == "Release Him" then triggerServerEvent("unJailHim",lp,sPlayer) end ---------- elseif ( source == jcBut ) then guiSetVisible (jWin, false) showCursor (false) guiSetInputEnabled(false) end end addEventHandler( "onClientGUIClick", root, onClick ) ------------ end ) addEventHandler("onClientPlayerDamage",root,function(at) if getElementData(source,"jailed") == true then if at then cancelEvent() end end end ) ------- addEventHandler("onClientGUIClick",root,function() if source == sEdit then guiSetText(sEdit,"") --[[ else guiSetText(sEdit,"Search ..") --]] end end ) addEventHandler("onClientGUIChanged",root,function() if source == sEdit then ------ guiGridListClear(pList) for k,v in ipairs ( getElementsByType("player") ) do local name = string.lower(getPlayerName(v)) if name then if string.find (name,string.lower(guiGetText(sEdit)) ) then row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( v ), false, false ) end end end end ------ end ) ------ function createTimeSelect(theJailed,theJail) if not tostring(theJailed) then outputChatBox("** #FFFF00Please Select a Player !",255,0,0,true) return end if not tostring(theJail) then outputChatBox("** #FFFF00Please Select a Jail !",255,0,0,true) return end if isElement(TimeSelect_Window) then return end TimeSelect_Window = guiCreateWindow(550,397,270,125,"Enter Time",false) -- local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(TimeSelect_Window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(TimeSelect_Window,x,y,false) -- -- guiSetVisible(jWin,false) -- TimeSelect_Edit = guiCreateEdit(15,37,89,26,"",false,TimeSelect_Window) TimeSelect_Label = guiCreateLabel(110,41,10,15,"in",false,TimeSelect_Window) TimeSelect_Grid = guiCreateGridList(126,31,130,95,false,TimeSelect_Window) guiGridListSetSelectionMode(TimeSelect_Grid,2) --- column = guiGridListAddColumn( TimeSelect_Grid, "", 0.80 ) r1 = guiGridListAddRow(TimeSelect_Grid) r2 = guiGridListAddRow(TimeSelect_Grid) r3 = guiGridListAddRow(TimeSelect_Grid) guiGridListSetItemText ( TimeSelect_Grid , r1, column, "Hours", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r2, column,"Minutes", false, false ) guiGridListSetItemText ( TimeSelect_Grid , r3, column, "Seconds", false, false ) TimeSelect_Button = guiCreateButton(14,72,91,40,"OK",false,TimeSelect_Window) -- function onOk() if source == TimeSelect_Button then -- removeEventHandler("onClientGUIClick",root,onOk) -- ---------------- theTime = guiGetText(TimeSelect_Edit) timeType = guiGridListGetItemText ( TimeSelect_Grid, guiGridListGetSelectedItem ( TimeSelect_Grid ) ) -- destroyElement(TimeSelect_Window) jailShow () -- if tonumber(theTime) then if tostring(timeType) then triggerServerEvent("JailHimx",lp,theJailed,theJail,theTime.." "..timeType,timeType,true) else outputChatBox("** #FFFF00Please Select , Hours or Minutes or Seconds !",255,0,0,true) end else outputChatBox("** #FFFF00Please Enter a Number !",255,0,0,true) end ---------------- end end addEventHandler("onClientGUIClick",root,onOk) end
  19. Can I change all gui textures with 1 script/resource? I really need it. Please If anyone has this, share with me. (Sorry for my grammar fails. Im Turkish) Thanks.
  20. local screenWidth, screenHeight = guiGetScreenSize() GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function showgui() if (vehicle) then GUIEditor.button[1] = guiCreateButton(981, 627, 39, 40, "1", false) guiSetAlpha(GUIEditor.button[1], 0.00) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[2] = guiCreateButton(1025, 627, 39, 40, "2", false) guiSetAlpha(GUIEditor.button[2], 0.00) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFFFF") GUIEditor.button[3] = guiCreateButton(981, 673, 39, 40, "4", false) guiSetAlpha(GUIEditor.button[3], 0.00) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFFFFFF") GUIEditor.button[4] = guiCreateButton(1025, 673, 39, 40, "5", false) guiSetAlpha(GUIEditor.button[4], 0.00) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFFFFFF") GUIEditor.button[5] = guiCreateButton(1069, 673, 39, 40, "6", false) guiSetAlpha(GUIEditor.button[5], 0.00) guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFFFFFFF") GUIEditor.button[6] = guiCreateButton(1069, 719, 39, 40, "9", false) guiSetAlpha(GUIEditor.button[6], 0.00) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFFFFFF") GUIEditor.button[7] = guiCreateButton(1025, 719, 39, 40, "8", false) guiSetAlpha(GUIEditor.button[7], 0.00) guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFFFFFFF") GUIEditor.button[8] = guiCreateButton(981, 719, 39, 40, "7", false) guiSetAlpha(GUIEditor.button[8], 0.00) guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFFFFFFF") GUIEditor.button[9] = guiCreateButton(1025, 765, 39, 40, "0", false) guiSetAlpha(GUIEditor.button[9], 0.00) guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFFFFFFF") GUIEditor.button[10] = guiCreateButton(892, 573, 39, 40, "CLEAR", false) guiSetAlpha(GUIEditor.button[10], 0.00) guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFF70000") GUIEditor.button[11] = guiCreateButton(892, 627, 39, 40, "DEMO", false) guiSetAlpha(GUIEditor.button[11], 0.00) guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FF66F92C") GUIEditor.button[12] = guiCreateButton(892, 673, 39, 40, "AM", false) guiSetAlpha(GUIEditor.button[12], 0.00) guiSetProperty(GUIEditor.button[12], "NormalTextColour", "FFE7E53D") GUIEditor.button[13] = guiCreateButton(892, 719, 39, 40, "PM", false) guiSetAlpha(GUIEditor.button[13], 0.00) guiSetProperty(GUIEditor.button[13], "NormalTextColour", "FF8D9096") GUIEditor.button[14] = guiCreateButton(892, 765, 39, 40, "ENTER", false) guiSetAlpha(GUIEditor.button[14], 0.00) guiSetProperty(GUIEditor.button[14], "NormalTextColour", "FF3F4145") GUIEditor.button[15] = guiCreateButton(981, 765, 39, 40, "-", false) guiSetAlpha(GUIEditor.button[15], 0.27) guiSetProperty(GUIEditor.button[15], "NormalTextColour", "FFFFFFFF") GUIEditor.button[16] = guiCreateButton(1069, 627, 39, 40, "3", false) guiSetAlpha(GUIEditor.button[16], 0.00) guiSetProperty(GUIEditor.button[16], "NormalTextColour", "FFFFFFFF") GUIEditor.edit[1] = guiCreateEdit(951, 575, 192, 32, "MM-DD-YYYY-HH-MM-AMPM", false) guiSetProperty(GUIEditor.edit[1], "NormalTextColour", "FF000100") guiEditSetMaxLength ( GUIEditor.edit[1], 21 ) end ) local dxfont0_BTTF = dxCreateFont("fonts/BTTF.ttf", 10) addEventHandler("onClientRender", root, function showgui() if (vehicle) then dxDrawImage(444, 559, 433, 269, "images/time_circuits.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("By: CsaliHUN", 745 - 1, 810 - 1, 873 - 1, 828 - 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745 + 1, 810 - 1, 873 + 1, 828 - 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745 - 1, 810 + 1, 873 - 1, 828 + 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745 + 1, 810 + 1, 873 + 1, 828 + 1, tocolor(0, 0, 0, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawText("By: CsaliHUN", 745, 810, 873, 828, tocolor(246, 92, 8, 255), 1.00, dxfont0_BTTF, "center", "center", false, false, false, false, false) dxDrawImage(878, 557, 275, 271, "images/buttons.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("", 951, 575, 1143, 607, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end ) addEventHandler ( "onClientGUIClick", GUIEditor.button[16], outputEditBox, false ) function outputEditBox ( button ) if button == "left" then local text = guiGetText ( GUIEditor.edit[1] ) outputChatBox("Uticél beállítva:",player,255,69,0) outputChatBox (( text ),player,255,69,0) outputChatBox("Érd el a 88 km/h sebességet az utazáshoz!",player,255,69,0) end end addEventHandler("onClientRender", root, showgui) addCommandHandler ( "bttf", showgui ) function HandleTheRendering ( ) addEventHandler("onClientRender", root, renderDisplay) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) SORRY FOR BAD ENGLISH Please help me, I made a GUI, that needs to show on when I enter a Tampa , but it didn't show on. And also can someone help me to make that if i click on a button it will write something to an edit box, then if i click on an other button it will send it to local chat. ((The buttons alpha = 0 because there's a picture behind them))
  21. السلام عليكم ورحمة الله تعالى وبراكته اريد فاكشن لفتح لوحة لادمن فقط يعني مثل لوحة الادمنية
  22. https://community.multitheftauto.com/index.php?p=resources&s=details&id=3251 I downloaded this script, but when i move a player to jail, he can access the FR GUI, and "escape" from jail. How can i disable FR GUI access from imprisoned peoples?
  23. Server Rules Hello CommunityI made a new server rules system !Most of MTA Servers are using bind and commands like 'F1' .. etc etc !But mine is different ! I have made Dx Window and you can change the color of the bar of the window and when the player hit the 'Info Pickup' he'll get this Dx Gui, he won't get 'Cursor' !Your question is how will the player close the window, i'll answer on itwhen the player leave the pickup the window will close autoyou can change server rules and add more pickupsi made this script without using debugscript so if you had any error or problem post it in a Commandenjoy Download Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14535 ScreenShots:
  24. Hello guys! I have small problem.. I want to disable line aftert the text in the guiCreateEdit Picture: It's possible?
  25. Lalalu

    GUI Problems

    Hello, i'm doing this post today because i need help with a script ( this script isn't obviusly created by me, i'm just modifying it, the original owner is "TorN" ) i don't know too much about guis, guieditor, i did it in the gui editor and there looks perfect, but i don't know how to add it to the .lua correctly, also i do not know how to fit with all the resolutions , i've been trying everything for hours, i hope u can reply this and help me with this CLIENT label = {} foodwindow = guiCreateWindow(388, 199, 465, 639,"COMBINI FRIENDLY",true) guiSetAlpha(foodwindow,225) guiSetProperty(foodwindow, "ImageColours", "tl:FFFFFE0C tr:FF0000FF bl:FF0000FF br:FFFFFE0C") guiCreateStaticImage ( 9, 26, 446, 200,"image.png",true,foodwindow) ramenimg = guiCreateStaticImage(38, 288, 157, 61, "ramen.png", true, foodwindow) pockyimg = guiCreateStaticImage(262, 289, 157, 60, "pocky.png", true, foodwindow) laysimg = guiCreateStaticImage(262, 372, 156, 60, "lays.png", true, foodwindow) omuraisuimg = guiCreateStaticImage(38, 543, 157, 60, "omuraisu.png", true, foodwindow) picanteimg = guiCreateStaticImage(262, 458, 157, 60, "picante.png", true, foodwindow) tartaletaimg = guiCreateStaticImage(262, 543, 157, 61, "tartaleta.png", true, foodwindow) yakisobaimg = guiCreateStaticImage(38, 372, 157, 60, "yakisoba.png", true, foodwindow) onigiriimg = guiCreateStaticImage(38, 458, 157, 60, "onigiri.png", true, foodwindow) closebtn = guiCreateButton(119, 235, 219, 43, "CERRAR", true, foodwindow) guiSetVisible(foodwindow, false) guiSetProperty(closebtn, "NormalTextColour", "FFAAAAAA") GUIEditor.label[2] = guiCreateLabel(437, 550, 153, 20, "RAMEN INSTANTANEO", false) guiLabelSetColor(GUIEditor.label[2], 255, 252, 0) GUIEditor.label[3] = guiCreateLabel(468, 633, 153, 20, "YAKISOBA", false) guiLabelSetColor(GUIEditor.label[3], 255, 252, 0) GUIEditor.label[4] = guiCreateLabel(478, 719, 153, 20, "ONIGIRI", false) guiLabelSetColor(GUIEditor.label[4], 255, 252, 0) GUIEditor.label[5] = guiCreateLabel(473, 804, 153, 20, "OMURAISU", false) guiLabelSetColor(GUIEditor.label[5], 255, 252, 0) GUIEditor.label[6] = guiCreateLabel(700, 804, 153, 20, "TARTALETA", false) guiLabelSetColor(GUIEditor.label[6], 255, 252, 0) GUIEditor.label[7] = guiCreateLabel(694, 633, 153, 20, "PAPAS LAYS", false) guiLabelSetColor(GUIEditor.label[7], 255, 252, 0) GUIEditor.label[8] = guiCreateLabel(700, 550, 153, 20, "POCKYS", false) guiLabelSetColor(GUIEditor.label[8], 255, 252, 0) GUIEditor.label[9] = guiCreateLabel(684, 719, 153, 20, "PAPAS PICANTES", false) guiLabelSetColor(GUIEditor.label[9], 255, 252, 0) end ) function lol (hitElement) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(foodwindow,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(foodwindow,x,y,false) if hitElement == getLocalPlayer() then guiSetVisible(foodwindow, true) showCursor(true) centerWindow(foodwindow) end end function createramen() ramen = createMarker(443.5146484375, -6.431640625, 1059.5,"cylinder", 1, 60, 60, 60,250) setElementDimension(ramen, 5) setElementInterior(ramen, 1) addEventHandler('onClientMarkerHit', ramen, lol) end addEventHandler('onClientResourceStart', getResourceRootElement(),createramen) function createburgers() omuraisu = createMarker(443.5146484375, -6.431640625, 1059.5,"cylinder", 1, 60, 60, 60,250) setElementDimension(omuraisu, 66) setElementInterior(omuraisu, 1) addEventHandler('onClientMarkerHit', omuraisu, lol) end addEventHandler('onClientResourceStart', getResourceRootElement(),createburgers) function createpocky() pocky = createMarker(443.5146484375, -6.431640625, 1059.5,"cylinder", 1, 60, 60, 60,250) setElementDimension(pocky, 8) setElementInterior(pocky, 1) addEventHandler('onClientMarkerHit', pocky, lol) end addEventHandler('onClientResourceStart', getResourceRootElement(),createpocky) function close () guiSetVisible(foodwindow, false) showCursor(false) end addEventHandler("onClientGUIClick", closebtn, close) function lays() if getPlayerMoney(player) >= 150 then inc = 150 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("lays", getLocalPlayer()) outputChatBox("Has comprado Papas Lays por: 150¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", laysimg, lays) function ramen() if getPlayerMoney(player) >= 400 then inc = 400 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("ramen", getLocalPlayer()) outputChatBox("Has comprado Ramen instantáneo por: 400¥", 0, 255, 250, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", ramenimg, ramen) function pocky() if getPlayerMoney(player) >= 200 then inc = 200 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("pocky", getLocalPlayer()) outputChatBox("Has comprado Pockys por: 200¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", pockyimg, pocky) function omuraisu() if getPlayerMoney(player) >= 300 then inc = 300 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("omuraisu", getLocalPlayer()) outputChatBox("Has comprado Omuraisu por: 300¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", omuraisuimg, omuraisu) function picante() if getPlayerMoney(player) >= 200 then inc = 200 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("picante", getLocalPlayer()) outputChatBox("Has comprado Papas Picantes por: 200¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", picanteimg, picante) function tartaleta() if getPlayerMoney(player) >= 1000 then inc = 1000 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("tartaleta", getLocalPlayer()) outputChatBox("Has comprado una Tartaleta por: 1000¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", tartaletaimg, tartaleta) function yakisoba() if getPlayerMoney(player) >= 300 then inc = 300 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("yakisoba", getLocalPlayer()) outputChatBox("Has comprado Yakisoba por: 300¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", yakisobaimg, yakisoba) function onigiri() if getPlayerMoney(player) >= 250 then inc = 250 player = getLocalPlayer () setElementHealth(player, getElementHealth(player) + inc) triggerServerEvent("onigiri", getLocalPlayer()) outputChatBox("Has comprado Onigiri por: 250¥", 0, 255, 0, player) else outputChatBox("Necesitas más dinero para comprar ",255,0,250) end end addEventHandler("onClientGUIClick", onigiriimg, onigiri)
×
×
  • Create New...