Taka

Members
  • Content count

    30
  • Joined

  • Last visited

Community Reputation

7 Neutral

About Taka

  • Rank
    Rat
  1. [Release]thisdp's Dx GUI System

    dgsDxEditSetMaxLength not work if paste text through dgsDxGUISetText
  2. [Release]thisdp's Dx GUI System

    You can make the flashing pipe (| - pipe) invisible when ReadOnly is true?
  3. [Release]thisdp's Dx GUI System

    DGS = exports.dgs addEventHandler("onClientResourceStart", resourceRoot, function() createBlip(2827.34, 1290.94, 10.76, 55, 2, 255, 0, 0, 255, 0, 250) carMarker = createMarker(2827.34, 1290.94, 9.6, "cylinder", 2.0, 0, 0, 255, 155) end ) carGUI = {} function markerTrigger(hitPlayer) if source == carMarker then showCursor(true) carGUI.win = DGS:dgsDxCreateWindow(0.75, 0.35, 0.25, 0.5, "Автомагазин", true) carGUI.window = DGS:dgsDxCreateTabPanel(0, 0, 1, 1, true, carGUI.win) carGUI.tab1 = DGS:dgsDxCreateTab("BMW", carGUI.window) carGUI.grid1 = DGS:dgsDxCreateGridList(0, 0, 1, 1, true, carGUI.tab1) carGUI.grid1Name = DGS:dgsDxGridListAddColumn(carGUI.grid1, "Название", 0.3) carGUI.grid1Price = DGS:dgsDxGridListAddColumn(carGUI.grid1, "Цена", 0.1) carGUI.tab2 = DGS:dgsDxCreateTab("VAZ", carGUI.window) carGUI.grid2 = DGS:dgsDxCreateGridList(0, 0, 1, 1, true, carGUI.tab2) carGUI.grid2Name = DGS:dgsDxGridListAddColumn(carGUI.grid2, "Название", 0.3) carGUI.grid2Price = DGS:dgsDxGridListAddColumn(carGUI.grid2, "Цена", 0.1) setCameraMatrix(2814.61, 1316.01, 10.75) --setElementDimension(localPlayer, 100) triggerServerEvent("onClientOpenCarShop", localPlayer) end end addEventHandler("onClientMarkerHit", getRootElement(), markerTrigger) cars = {} function addCarsToGrids(name, price, mark, model) cars.name = { price = tonumber(price), model = tonumber(model), name = name } if mark == "BMW" then local row = DGS:dgsDxGridListAddRow(carGUI.grid1) DGS:dgsDxGridListSetItemText(carGUI.grid1, row, carGUI.grid1Name, name) DGS:dgsDxGridListSetItemText(carGUI.grid1, row, carGUI.grid1Price, price) elseif mark == "VAZ" then local row = DGS:dgsDxGridListAddRow(carGUI.grid2) DGS:dgsDxGridListSetItemText(carGUI.grid2, row, carGUI.grid2Name, name) DGS:dgsDxGridListSetItemText(carGUI.grid2, row, carGUI.grid2Price, price) end end addEvent("getCar", true) addEventHandler("getCar", getRootElement(), addCarsToGrids) function clickTrigger(button, state) outputChatBox(source) if button == "left" and state == "up" then if source == carGUI.grid1 then local selected = DGS:dgsDxGridListGetSelectedItem(carGUI.grid1) if selected ~= -1 then if carGUI.buyButton == nil then carGUI.buyButton = DGS:dgsDxCreateButton(0.3, 0.7, 0.3, 0.15, "Купить", true) end local name = DGS:dgsDxGridListGetItemText(carGUI.grid1, selected, carGUI.grid1Name) if getElementType(car) == "vehicle" then blowVehicle(car, false) end car = createVehicle(cars.name.model, 2802.79, 1309.43, 10.89) --setElementDimension(car, 100) outputChatBox(cars.name.name) outputChatBox(cars.name.model) end elseif source == carGUI.grid2 then local selected = DGS:dgsDxGridListGetSelectedItem(carGUI.grid2) if selected ~= -1 then if carGUI.buyButton == nil then carGUI.buyButton = DGS:dgsDxCreateButton(0.3, 0.7, 0.3, 0.15, "Купить", true) end local name = DGS:dgsDxGridListGetItemText(carGUI.grid2, selected, carGUI.grid2Name) if getElementType(car) == "vehicle" then blowVehicle(car, false) end car = createVehicle(cars.name.model, 2802.79, 1309.43, 10.89) outputChatBox(cars.name.name) outputChatBox(cars.name.model) end end end end addEventHandler("onClientDgsDxMouseClick", getRootElement(), clickTrigger) function windowClosed() if source == carGUI.win then showCursor(false) setCameraTarget(localPlayer, localPlayer) setElementDimension(localPlayer, 0) destroyElement(carGUI.buyButton) end end addEventHandler("onClientDgsDxWindowClose", getRootElement(), windowClosed)
  4. [Release]thisdp's Dx GUI System

    Another problem with tab panel. If i create tab panel with 2 tabs and inside them gridlist then if I click on an row in gridlist in tab 1, DGS considers that I clicked on the row in the second tab.
  5. [Release]thisdp's Dx GUI System

    Can not write to the edit in the second tab, if the first tab has a edit in the same place
  6. [Rel] Lunix Phone Green [SmartPhone]

    It's sad that our compatriots always do this.
  7. Simple MySQL query.

    function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT * FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result = dbPoll(query, -1) if #result > 0 then -- Match found success for row, rowData in ipairs(result) do setElementData(Client, "id", tonumber(rowData['id'])) end end end
  8. [Help]Redirect Server player

    Change "player" in argument to "thePlayer" from redirectPlayer function
  9. Simple MySQL query.

    Oops. function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT * FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result, num_rows = dbPoll(query, -1) if num_rows > 0 then -- Match found success for row, rowData in ipairs(result) do -- rowData['column name'] outputChatBox(rowData['username']) outputChatBox(rowData['password']) end end end
  10. Simple MySQL query.

    function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT * FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result = dbPoll(query, -1) if result > 0 then -- Match found success for row, rowData in ipairs(result) do -- rowData['column name'] outputChatBox(rowData['username']) outputChatBox(rowData['password']) end end end
  11. Simple MySQL query.

    function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT `username`, `password` FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result = dbPoll(query, -1) if result > 0 then -- Match found success end end
  12. function loginPanel() sound = playSound("sounds/music.mp3", true) -- client code of login panel end addEventHandler("onClientResourceStart", getRootElement(), loginPanel) -- function that triggers upon successful authorization function destroyLoginPanel() stopSound(sound) -- cliend code of success login end https://wiki.multitheftauto.com/wiki/PlaySound https://wiki.multitheftauto.com/wiki/StopSound
  13. Which is the best MTA Lua Editor?

    Sublime Text 3 + 50p (snippets) package
  14. [Release]thisdp's Dx GUI System

    Can I somehow return the font from 2.78?
  15. Did for my server, but now I decided to tackle another idea. So I decided to share it. In the archive is a table in which there are 893 zones throughout the map and the owner's column (Everywhere is "Citizen") and a column with the names of the zones (in Russian). ALMOST perfectly smooth. Download: https://community.mtasa.com/index.php?p=resources&s=details&id=14656 Screenshot: