Ayee Posted May 8, 2018 Share Posted May 8, 2018 local sx,sy = guiGetScreenSize() addEvent("onInventoryShowNeeded",true) addEventHandler("onInventoryShowNeeded", root, function(items) if not isElement(invwdw) then invwdw = guiCreateWindow((sx - 291)/2,(sy - 445)/2, 291, 445, "GTE:RPG Inventory", false) guiWindowSetSizable(invwdw, false) logo = guiCreateStaticImage(70, 22, 149, 56, ":SAEGLogin/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("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) Quote its errors ERROR: Server Triggered clientside event hideinventory,but event is not added clientside ERROR: Server Triggered clientside event showinventory,but event is not added clientside thanks for Read. if u can help please help me Link to comment
Hoffmann Posted May 8, 2018 Share Posted May 8, 2018 (edited) Clientside events hideinventory and showinventory are missed. I don't see them in your code. Edited May 8, 2018 by NeverUnbeatable Link to comment
Ayee Posted May 8, 2018 Author Share Posted May 8, 2018 2 hours ago, NeverUnbeatable said: Clientside events hideinventory and showinventory are missed. I don't see them in your code. yes i think problem in them can u help me? Link to comment
Addlibs Posted May 8, 2018 Share Posted May 8, 2018 (edited) You need to add those events. If you can't do it yourself, there's no reason for you to be here, as we are not here to code for you. Edited May 8, 2018 by MrTasty Link to comment
Ayee Posted May 8, 2018 Author Share Posted May 8, 2018 3 hours ago, MrTasty said: You need to add those events. If you can't do it yourself, there's no reason for you to be here, as we are not here to code for you. im asking for help from Good One not from you i didnt ask u for help then dont talk 1 Link to comment
Moderators IIYAMA Posted May 8, 2018 Moderators Share Posted May 8, 2018 4 hours ago, Maxman said: im asking for help from Good One not from you i didnt ask u for help then dont talk You may haven't notice it, but you are making an unwanted request. Please read the scripting section rules, to understand why this request is unwanted. Good luck with learning lua. Link to comment
Storm-Hanma Posted May 9, 2018 Share Posted May 9, 2018 (edited) Problem is to easy to solve pls read the errors carefully it says you have not added server side functions go through serverside code again ,client side code is correct only issue on server side code !! Edited May 9, 2018 by Khadeer143 Link to comment
VenomOG Posted May 13, 2018 Share Posted May 13, 2018 Don't help him staffs he is using smug resources stolen Link to comment
Tando Posted June 8, 2018 Share Posted June 8, 2018 On 5/13/2018 at 04:44, Venon1 said: Don't help him staffs he is using smug resources stolen yea +1 he using SAUGInventory stolen no one help him plz 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