Tando Posted June 1, 2018 Share Posted June 1, 2018 (edited) Hello everybody, I Tired from Work in Inventory to Put DrugEffect/Drug Draw Time As i know only @_DrXenon , @Oussema have inventory oF STORM/SAEG Client .lua May i get Help in it May i get Help in DrugEffect/DrugDXDraw For Time here or get Full Inventory ! Client: local sx,sy = guiGetScreenSize() addEvent("Hiddeny",true) addEventHandler("Hidden", root, function(items) if not isElement(invwdw) then invwdw = guiCreateWindow((sx - 291)/2,(sy - 445)/2, 291, 445, "SAUG Inventory", false) guiWindowSetSizable(invwdw, false) logo = guiCreateStaticImage(70, 22, 149, 56, ":SAUGLogin/logo.png", false, invwdw) invgrid = guiCreateGridList(9, 81, 273, 311, false, invwdw) guiGridListAddColumn(invgrid, "Item", 0.5) guiGridListAddColumn(invgrid, "Quantitiy", 0.5) for i,v in ipairs(items) do row = guiGridListAddRow(invgrid) guiGridListSetItemText(invgrid, row, 1, v["item"], false, false) guiGridListSetItemText(invgrid, row, 2, v["quant"].." unit(s)", false, false) end closebtn = guiCreateButton(213, 396, 69, 39, "Close", false, invwdw) infolabel = guiCreateLabel(10, 396, 196, 36, "Double mouse 'Right' click to use!\nDouble mouse 'Left' click to drop!", false, invwdw) guiSetFont(infolabel, "default-bold-small") guiLabelSetHorizontalAlign(infolabel, "center", false) guiLabelSetVerticalAlign(infolabel, "center") else destroyElement(invwdw) end end ) addEventHandler("onClientGUIClick",root,function() if isElement(invwdw) then if source == closebtn then destroyElement(invwdw) end end end) addEventHandler("onClientGUIDoubleClick",root,function() if isElement(invwdw) then if source == invgrid then local sel = guiGridListGetSelectedItem(invgrid) local item = guiGridListGetItemText(invgrid,sel,1) local quan = guiGridListGetItemText(invgrid,sel,2) local quan = string.gsub(quan,"unit(s)","") local quan = tonumber(quan) triggerServerEvent("useItem",localPlayer,item) end end end) addEvent("updateInvGridList",true) addEventHandler("updateInvGridList",root,function(items) if isElement(invwdw) then destroyElement(invgrid) --local items = getElementData(localPlayer,"inventoryitems") invgrid = guiCreateGridList(9, 81, 273, 311, false, invwdw) guiGridListAddColumn(invgrid, "Item", 0.5) guiGridListAddColumn(invgrid, "Quantitiy", 0.5) for i,v in ipairs(items) do row = guiGridListAddRow(invgrid) guiGridListSetItemText(invgrid, row, 1, v["item"] or v[1], false, false) guiGridListSetItemText(invgrid, row, 2, (v["quant"] or v[2]).." unit(s)", false, false) end end end) Edited June 2, 2018 by CodyJ(L) Fixed Lua Link to comment
Skully Posted June 1, 2018 Share Posted June 1, 2018 Please put your code in <> code tags, not a quote. Also, we're not going to write a whole drug system for you, learn how to script LUA and do it yourself. You can start off by reading the MTA wiki, specifically the scripting introduction page. Link to comment
Storm-Hanma Posted June 2, 2018 Share Posted June 2, 2018 I can make you whole new system not clone of saeg or any servers if you can pay me 1 Link to comment
Hani2001 Posted June 2, 2018 Share Posted June 2, 2018 local sx,sy = guiGetScreenSize() addEvent("Hiddeny",true) addEventHandler("Hidden", root, function(items) if not isElement(invwdw) then invwdw = guiCreateWindow((sx - 291)/2,(sy - 445)/2, 291, 445, "SAUG Inventory", false) guiWindowSetSizable(invwdw, false) logo = guiCreateStaticImage(70, 22, 149, 56, ":SAUGLogin/logo.png", false, invwdw) invgrid = guiCreateGridList(9, 81, 273, 311, false, invwdw) guiGridListAddColumn(invgrid, "Item", 0.5) guiGridListAddColumn(invgrid, "Quantitiy", 0.5) for i,v in ipairs(items) do row = guiGridListAddRow(invgrid) guiGridListSetItemText(invgrid, row, 1, v["item"], false, false) guiGridListSetItemText(invgrid, row, 2, v["quant"].." unit(s)", false, false) end closebtn = guiCreateButton(213, 396, 69, 39, "Close", false, invwdw) infolabel = guiCreateLabel(10, 396, 196, 36, "Double mouse 'Right' click to use!\nDouble mouse 'Left' click to drop!", false, invwdw) guiSetFont(infolabel, "default-bold-small") guiLabelSetHorizontalAlign(infolabel, "center", false) guiLabelSetVerticalAlign(infolabel, "center") else destroyElement(invwdw) end end ) addEventHandler("onClientGUIClick",root,function() if isElement(invwdw) then if source == closebtn then destroyElement(invwdw) end end end) addEventHandler("onClientGUIDoubleClick",root,function() if isElement(invwdw) then if source == invgrid then local sel = guiGridListGetSelectedItem(invgrid) local item = guiGridListGetItemText(invgrid,sel,1) local quan = guiGridListGetItemText(invgrid,sel,2) local quan = string.gsub(quan,"unit(s)","") local quan = tonumber(quan) triggerServerEvent("useItem",localPlayer,item) end end end) addEvent("updateInvGridList",true) addEventHandler("updateInvGridList",root,function(items) if isElement(invwdw) then destroyElement(invgrid) --local items = getElementData(localPlayer,"inventoryitems") invgrid = guiCreateGridList(9, 81, 273, 311, false, invwdw) guiGridListAddColumn(invgrid, "Item", 0.5) guiGridListAddColumn(invgrid, "Quantitiy", 0.5) for i,v in ipairs(items) do row = guiGridListAddRow(invgrid) guiGridListSetItemText(invgrid, row, 1, v["item"] or v[1], false, false) guiGridListSetItemText(invgrid, row, 2, (v["quant"] or v[2]).." unit(s)", false, false) end end end) Link to comment
Tando Posted June 2, 2018 Author Share Posted June 2, 2018 14 hours ago, Khadeer143 said: I can make you whole new system not clone of saeg or any servers if you can pay me i can't pay 16 hours ago, mazen54 said: Easy if easy so where is it ? Link to comment
mazen54 Posted June 3, 2018 Share Posted June 3, 2018 On 6/2/2018 at 21:52, Tando said: if easy so where is it ? so why i have to say ? ican do it in 10min only and ez Link to comment
Tando Posted June 8, 2018 Author Share Posted June 8, 2018 On 6/3/2018 at 22:02, mazen54 said: so why i have to say ? ican do it in 10min only and ez so do it lool if you don't need to say so don't reply Link to comment
Moderators IIYAMA Posted July 26, 2018 Moderators Share Posted July 26, 2018 On 8-6-2018 at 14:23, (SAUG)Tando said: so do it lool if you don't need to say so don't reply It is the same for you. Don't post and reply here in the scripting section with code requests. Your post and replies are unwanted according to the section rules. Before posting in this section, please read the rules and have a nice day or two. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now