-.Paradox.- Posted December 13, 2013 Posted December 13, 2013 Hello, i was searching in forum about a weapon inventory, and i found this, but i don't know why it doesnt work, here is the code thanks. local player = getLocalPlayer() tab = guiCreateTabPanel(429, 151, 430, 404, true) tab_inventory = guiCreateTab("Weapon:", tab) inventory_gridlist = guiCreateGridList (0.03, 0.03, 0.46, 0.94, true, tab_inventory) weapSlots = guiGridListAddColumn(inventory_gridlist, "slots", 0.9) function weapItemInInventory ( ) if ( weapSlots ) then for slot = 1, 12 do local weapon = getPedWeapon ( localPlayer, slot ) if ( weapon > 0 ) then local row = guiGridListAddRow ( inventory_gridlist ) guiGridListSetItemText ( inventory_gridlist, row, weapSlots, getWeaponNameFromID ( weapon ), false, false ) end end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), weapItemInInventory ) setTimer ( function ( ) guiGridListClear ( inventory_gridlist ) weapItemInInventory ( ) end, 5000, 0 ) function enableInv() if guiGetVisible(tab) == false then guiSetVisible(tab, true) showCursor(true) else guiSetVisible(tab, false) showCursor(false) end end bindKey("B","down", enableInv) If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
ViRuZGamiing Posted December 13, 2013 Posted December 13, 2013 errors? Debug? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
-.Paradox.- Posted December 13, 2013 Author Posted December 13, 2013 No nothing If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted December 13, 2013 Posted December 13, 2013 And what is the problem exactly? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted December 13, 2013 Author Posted December 13, 2013 The gui dont want to open i can see only cursor If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted December 13, 2013 Posted December 13, 2013 Looks like it's a position problem, since I've centered it using a function and the tab panel shown up. local sx, sy = guiGetScreenSize ( ) function centerGUI ( guiElement ) local width, height = guiGetSize ( guiElement, false ) local x, y = ( sx / 2 - width / 2 ), ( sy / 2 - height / 2 ) guiSetPosition ( guiElement, x, y, false ) end tab = guiCreateTabPanel(429, 151, 430, 404, true) guiSetVisible ( tab, false ) centerGUI ( tab ) tab_inventory = guiCreateTab("Weapon:", tab) inventory_gridlist = guiCreateGridList (0.03, 0.03, 0.46, 0.94, true, tab_inventory) weapSlots = guiGridListAddColumn(inventory_gridlist, "slots", 0.9) function weapItemInInventory ( ) if ( weapSlots ) then for slot = 1, 12 do local weapon = getPedWeapon ( localPlayer, slot ) if ( weapon > 0 ) then local row = guiGridListAddRow ( inventory_gridlist ) guiGridListSetItemText ( inventory_gridlist, row, weapSlots, getWeaponNameFromID ( weapon ), false, false ) end end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), weapItemInInventory ) setTimer ( function ( ) guiGridListClear ( inventory_gridlist ) weapItemInInventory ( ) end, 5000, 0 ) function enableInv ( ) local state = ( not guiGetVisible ( tab ) ) guiSetVisible(tab, state) showCursor ( state ) end bindKey ( "B", "down", enableInv ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted December 14, 2013 Author Posted December 14, 2013 Working thanks, but it show a big tab and i want only small one and thanks again. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted December 14, 2013 Posted December 14, 2013 Well, you must change the position of it, I added to center it just for test. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted December 14, 2013 Author Posted December 14, 2013 I changed it If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted December 14, 2013 Posted December 14, 2013 And is working fine? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted December 14, 2013 Author Posted December 14, 2013 Yes it's working but the tab is on all the screen, still the same problem, shall i remove center? If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted December 14, 2013 Posted December 14, 2013 Well, that function only centers it, it doesn't resize it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted December 22, 2013 Author Posted December 22, 2013 So how can i fix it? If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
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