freudo Posted October 29, 2014 Posted October 29, 2014 I need help This code its working but ı dont send clientside pls help me! İts work but Don't refresh gridlist server: local amountOfTopsToDisplay = 3 -- how many tops you need function ToplistServerClans(player, command) local file = xmlLoadFile("clans.xml") -- load file if file then -- if file exists local tableOrder = {} -- make a table local subTable = {} -- make a sub table for i,v in ipairs(xmlNodeGetChildren(file)) do -- get children from file subTable.name = xmlNodeGetAttribute(v, "isim") -- name goes in subTable subTable.data = xmlNodeGetAttribute(v, "ClanWin") -- data goes in subTable table.insert(tableOrder, subTable) -- subTable is inserted in bigger table subTable = {} -- empty subTable for next loop end table.sort(tableOrder, function(a,b) return tonumber(a.data) > tonumber(b.data) end) -- put data in order for i,v in ipairs(tableOrder) do -- loop the sorted table outputChatBox("#f4a460[TOP]#ffffffEn iyi #ff33333 #ffffffClan!",root,255,0,0,true) outputChatBox(i..". "..v.name.." - #ff3333"..v.data, player, 255,255,255,true) -- display in order if i == amountOfTopsToDisplay then break end -- when enough tops has been shown, break it end xmlUnloadFile(file) -- unload the file from memory triggerClientEvent("onServerTopClans",player,tableOrder) end end addCommandHandler("topclans",ToplistServerClans) client: addEvent("onServerTopClans", true) addEventHandler("onServerTopClans", getRootElement(), function(tableOrder) if (guiGridListClear) then local topList if tableOrder then for i=1,10 do if tableOrder[i] then local column = guiGridListAddColumn(clantopgrid, "Sıra", 0.15) local column1 = guiGridListAddColumn(clantopgrid, "Clanlist", 0.55) local column2 = guiGridListAddColumn(clantopgrid, "Puan", 0.30) local row = guiGridListAddRow(clantopgrid) guiGridListSetItemText(clantopgrid, row, column,i, false, false) guiGridListSetItemText(clantopgrid, row, column1,removeColorCoding(tableOrder[i].name), false, false) guiGridListSetItemText(clantopgrid, row, column2,tostring(tableOrder[i].data), false, false) local r, g, b local playerTeam = getPlayerTeam( source ) if ( playerTeam ) then r, g, b = getTeamColor ( playerTeam ) guiGridListSetItemColor ( clantopgrid, row, column1, r, g, b ) guiGridListSetItemColor ( clantopgrid, row, column2, r, g, b ) guiGridListSetItemColor ( clantopgrid, row, column, r, g, b ) end end end end end end) please open new tab this image WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
Moderators IIYAMA Posted October 29, 2014 Moderators Posted October 29, 2014 Empty the grid list first. https://wiki.multitheftauto.com/wiki/GuiGridListClear Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
freudo Posted October 29, 2014 Author Posted October 29, 2014 ı try but dont work and lost data WOC-DD Destruction Derby -Level system -Clan system -Topwins -Event system for EXP -Podium with animation And more
Moderators IIYAMA Posted October 29, 2014 Moderators Posted October 29, 2014 Well check the variables(if the table has it's data etc.) and at which part it stops working. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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