
thund3rbird23
Members-
Content Count
119 -
Joined
-
Last visited
Community Reputation
10 DecentAbout thund3rbird23
-
Rank
Sucka
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Check if vehicle is nearby by vehicle's plate?
thund3rbird23 replied to thund3rbird23's topic in Scripting
The vehicle ID is the primary key in database. (id column) -
Check if vehicle is nearby by vehicle's plate?
thund3rbird23 replied to thund3rbird23's topic in Scripting
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 -
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
-
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
Oh. Okay working fine. You are always right -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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 -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
[A], , So the problem is the source isn't correct? I'm calling the source (gridlist) from the "onLoadOwnWeapons" event -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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. -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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 -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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) -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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. -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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: -- -
gridlist load data only if I restart the resource (thisdp's GUI)
thund3rbird23 replied to thund3rbird23's topic in Scripting
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 -
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
-
dxDrawText get the value of the clicked text?
thund3rbird23 replied to thund3rbird23's topic in Scripting
Yes.. I wrote the question first then thought about that ... sorry and thank you. You helped me a lot -
dxDrawText get the value of the clicked text?
thund3rbird23 replied to thund3rbird23's topic in Scripting
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