-.Paradox.- Posted November 9, 2013 Posted November 9, 2013 Hello, i maked a panel that get ped stats like the one in freeroam resource and i want it to work with xml, i want really to make it myself but idk about xml functions or how to use, thanks for help. GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[1] = guiCreateWindow(834, 170, 299, 463, "Stat panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(10, 27, 279, 395, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Stat", 0.4) guiGridListAddColumn(GUIEditor.gridlist[1], "Value", 0.4) guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "AK-47", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Deagle", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "M4", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "MP5", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "Pistol", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "Sawnoff shotgun", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "Shotgun", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "Silenced pistol", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 8, 1, "Sniper rifle", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 8, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 9, 1, "Spaz-12", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 9, 2, "Value", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 10, 1, "Uzi", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 10, 2, "Value", false, false) GUIEditor.button[1] = guiCreateButton(113, 429, 45, 20, "close", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") guiSetVisible(GUIEditor.window[1], false) showCursor(false) function enableStatPanel() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey ( "H","down", enableStatPanel ) My XML Format 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 November 9, 2013 Posted November 9, 2013 Use: xmlLoadFile xmlNodeGetChildren xmlNodeGetAttribute San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted November 9, 2013 Author Posted November 9, 2013 Done thanks. 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 November 9, 2013 Posted November 9, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted November 9, 2013 Author Posted November 9, 2013 Got a little problem i want refresh the stats every 1 second, what i have to do? 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 November 9, 2013 Posted November 9, 2013 Use a timer. setTimer San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted November 9, 2013 Author Posted November 9, 2013 And events? 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 November 9, 2013 Posted November 9, 2013 Events for what? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted November 9, 2013 Author Posted November 9, 2013 (edited) Oh sorry, i mean i don't know a lot about those stuffs can i post you my code? The problem is i didn't maked it with xml, i used getPedStat for every row, so i need help. Here is the code: SOLVED Edited November 10, 2013 by Guest 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.
-.Paradox.- Posted November 9, 2013 Author Posted November 9, 2013 Tried but I crashed it, so I tried this way. 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.
TAPL Posted November 9, 2013 Posted November 9, 2013 StatTable = { {"Weapon Skills", ""}, {"AK-47", 77}, {"M4", 78}, {"MP5", 76}, {"Pistol", 69}, {"Sawnoff Shotgun", 73}, {"Shotgun", 72}, {"Silenced Pistol", 70}, {"Sniper Rifle", 79}, {"Spaz-12", 74}, {"Uzi", 75}, {"Body Skills", ""}, {"Fat", 21}, {"Max Health", 24}, {"Stamina", 22}, {"Muscle", 23} } GUIEditor = { gridlist = {}, window = {}, button = {}} GUIEditor.window[1] = guiCreateWindow(581, 275, 375, 337, "Stat Panel", false) guiSetVisible(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(12, 25, 353, 257, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Stat", 0.4) guiGridListAddColumn(GUIEditor.gridlist[1], "Value", 0.4) GUIEditor.button[1] = guiCreateButton(105, 291, 158, 36, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") function enableStatPanel() if guiGetVisible(GUIEditor.window[1]) == false then updateGridList() if not isTimer(upTimer) then upTimer = setTimer(updateGridList, 3000, 0) end guiSetVisible(GUIEditor.window[1], true) showCursor(true) else if isTimer(upTimer) then killTimer(upTimer) end guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey("H","down", enableStatPanel) function updateGridList() guiGridListClear(GUIEditor.gridlist[1]) for _, i in pairs(StatTable) do local row = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], row, 1, i[1], false, false) guiGridListSetItemText(GUIEditor.gridlist[1], row, 2, i[2] ~= "" and getPedStat(localPlayer, i[2]) or "", false, false) end end function closeButton() guiSetVisible(GUIEditor.window[1], false) showCursor(false) if isTimer(upTimer) then killTimer(upTimer) end end addEventHandler("onClientGUIClick", GUIEditor.button[1], closeButton, false)
-.Paradox.- Posted November 10, 2013 Author Posted November 10, 2013 Working thanks. 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