Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

10 Decent

About thund3rbird23

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The vehicle ID is the primary key in database. (id column)
  2. I'm getting the vehicle plate text from a client-side gui gridlist selection and want to check if the vehicle with the selected plate text is nearby then I can do whatever what I want with the vehicle. I had to modify the positions variable the positions debug is working well but I always getting "Vehicle is not nearby" doesn't matter if I'm close to the vehicle or not. And the vehicle position doesn't change while the player is in-game. That will change after the player is disconnected so I don't think so that's the good way of the vehicle's position?! function SetVehicleSell
  3. I want to check if the selected vehicle is nearby by the vehicle's plate. I'm getting the vehicle's plate text from client-side gui (gridlist selection) then I query that plate from mysql in server-side and want to check if that is nearby or not. function SetVehicleSellingDB(vehPlate) local query = dbQuery(con, "SELECT * FROM vehicle WHERE plate=?", vehPlate) local result = dbPoll(query, -1) if result then local vehicleplate = result[1]["plate"] --- I getting the selected vehicle's plate from client-side gui succesfully local vehicle = getNearestVehicle( vehicleplate ) --- this doe
  4. Now the local Selected = DGS:dgsGridListGetSelectedItem(gridlist) iprint("Selected is correct:", Selected ~= -1, ">input>", Selected ) Selected returns false. But before that it worked without any problem
  5. [A], , So the problem is the source isn't correct? I'm calling the source (gridlist) from the "onLoadOwnWeapons" event
  6. No errors in debug and if I put only outputChatBox("clicked") inside the SellBttnClick function then displays that... so yes the function gets called after clicking.
  7. Thank you. Now it seems to work... but I can't get the dgsGridListGetSelectedItem before it's worked when I used onResourceStart event handler. Do you have any idea? addEvent("onLoadOwnWeapons", true) addEventHandler("onLoadOwnWeapons", localPlayer, function (items) weapwindow = DGS:dgsCreateWindow(screenW - 278 - 10, (screenH - 237) / 2, 278, 237,"Your Weapons",false) DGS:dgsWindowSetCloseButtonEnabled(weapwindow, false) DGS:dgsWindowSetMovable ( weapwindow, false ) gridlist = DGS:dgsCreateGridList (0.04, 0.01, 0.92, 0.58, true, weapwindow ) local items = getElement
  8. Uh okay I'm totally lost... I need those table when I open the gui window. I set the guivisible true when I click on a button from another window. This is the main window but I need to set the guivisible false so we can't see the gui always. The items variable doesn't work here I just left it there to better illustrate what I want to do. (I need to put the table in the gridlist but only after I click on a button) function test() weapwindow = DGS:dgsCreateWindow(screenW - 278 - 10, (screenH - 237) / 2, 278, 237,"Your Weapons",false) DGS:dgsSetVisible(weapwindow, false)
  9. items debug is false items2 debug is the table what I need. Screenshot: https://i.imgur.com/33JanAb.png EDIT: my bad... I misspelled a word in items variable. The items & items2 debug is the table what I want.
  10. I'll try to describe it clearly I query the weaponmodels here: --- server.lua --- addEvent("loadOwnWeapons",true) addEventHandler("loadOwnWeapons",getRootElement(),function(player) local owner = getElementData(source, "acc:id") local query = dbQuery(con,"SELECT * FROM weapons WHERE owner = ?", owner) local weapons = dbPoll(query,-1) if weapons then local newTable = {} for k,v in ipairs(weapons) do newTable[#newTable + 1] = {v["weaponmodel"]} end setElementData(source, "weaponmodel", newTable) end end) Then I calling this server event in client-side: --
  11. I still don't understand what is the problem... look I added a button which is "refresh" the gridlist's items, when I click on that button and debug the items with iprint then I get only one string... for ex.: xyz123 and after I restart the resource and then click on the refresh button then I get the table which I need... But why? function refreshBttnClick() triggerServerEvent("loadOwnWeapons", localPlayer) DGS:dgsSetVisible(weaponwindow,false) weaponwindow = DGS:dgsCreateWindow(screenW - 278 - 10, (screenH - 237) / 2, 278, 237,"Your Weapons",false) DGS:dgsWindowSetCloseButtonEn
  12. Gridlist only load data if I restart the resource... I'm using thisdp's GUI ... I tried to load the weapons from server side when player joins but still the same. function loadweapons() triggerServerEvent("loadOwnWeapons", localPlayer) end addEventHandler("onClientPlayerJoin", getRootElement(), loadweapons) I set the window visible to false function test() weapwindow = DGS:dgsCreateWindow(screenW - 278 - 10, (screenH - 237) / 2, 278, 237,"Your Weapons",false) DGS:dgsSetVisible(weapwindow, false) DGS:dgsWindowSetCloseButtonEnabled(weapwindow, false) DGS:dgsWindowSetMov
  13. Yes.. I wrote the question first then thought about that ... sorry and thank you. You helped me a lot
  14. Thanks. I trying with thisdp's DX GUI System but for some reason it's display "clicked" multiple times in chatbox when I click to the "Sell" button... What do I doing wrong? I need to check the button left or right & the state of the button? function test() window = DGS:dgsCreateWindow(screenW - 278 - 10, (screenH - 237) / 2, 278, 237,"Your weapon list",false) gridlist = DGS:dgsCreateGridList (0.04, 0.11, 0.92, 0.78, true, window ) column = DGS:dgsGridListAddColumn(gridlist, "Weapons", 0.5) for k, v in ipairs(items) do row = DGS:dgsGridListA
  • Create New...