Jump to content

GridList


1LoL1

Recommended Posts

Hello, please can anyone help me how i can get more players with stats in gridlist? i always get only one player..

function stats (stat1, stat2, stat3)
guiGridListClear(stattab)
guiGridListAddRow(stattab)
guiGridListSetItemText(stattab, 0, 1, stat1[1], false, false)
guiGridListSetItemText(stattab, 0, 2, stat2[1], false, false)
guiGridListSetItemText(stattab, 0, 3, stat3[1], false, false)
end
addEvent("stats", true)
addEventHandler("stats", getRootElement(), stats)


function stats2 ()
	local stat1 = {}
	local stat2 = {}
	local stat3 = {}
	
	local result = dbQuery(database,"SELECT * FROM stats")
	local poll = dbPoll(result, -1)
	for i,v in ipairs(poll) do
		table.insert(stat1, v["stat1"])
		table.insert(stat2, v["stat2"])
		table.insert(stat3, v["stat3"])
	end
	triggerClientEvent(source, "stats", source, stat1, stat2, stat3)
end
addEvent("stats2", true)
addEventHandler("stats2", getRootElement(), stats2)

 

Edited by 1LoL1
Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...