adwyer434 Posted November 9, 2015 Share Posted November 9, 2015 So I added a client side function to show a menu with Take engine,Take tire,Take tankparts if (vengines < needengines) and ((getElementData(lply, "Engine") or 0) >= 1) then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Add Engine") setElementData(MenuLabel[MenuItems],"usedItem","addengine") end if (vtires < needtires) and ((getElementData(lply, "Tire") or 0) >= 1) then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Add Tire") setElementData(MenuLabel[MenuItems],"usedItem","addtire") end if (vparts < needparts) and ((getElementData(lply, "Tank Parts") or 0) >= 1) then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Add Tank Parts") setElementData(MenuLabel[MenuItems],"usedItem","addparts") end if vengines >= 1 then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Take Engine") setElementData(MenuLabel[MenuItems],"usedItem","takeengine") end if vtires >= 1 then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Take Tire (" .. vtires .. ")") setElementData(MenuLabel[MenuItems],"usedItem","taketire") end if vparts >= 1 then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Take Tank Parts") setElementData(MenuLabel[MenuItems],"usedItem","takeparts") end end end end But I'm stumped on how to added it server side,So the player can take the items Link to comment
Dealman Posted November 9, 2015 Share Posted November 9, 2015 You'll need to use triggerServerEvent for a client to send information to the server. Use addEvent to create a custom event and addEventHandler to handle your custom event. 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