serverside
function mapsList()
local resourceTable = getResources()
triggerClientEvent ( "clearGridList", getRootElement() )
for resourceKey, resourceValue in ipairs(resourceTable) do
local name = getResourceName(resourceValue)
local type1 = getResourceInfo ( resourceValue, "type" )
if type1 == "map" then
triggerClientEvent ( "sendMaps", getRootElement(), name)
else
cancelEvent()
end
end
end
addCommandHandler( "sendMaps", mapsList, false, false )
clientside
mapGridList = guiCreateGridList(7,12,183,350,false,tab6)
mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85)
guiGridListSetSelectionMode(mapGridList,2)
addEvent("sendMaps", true )
function sendmaps(name)
row = guiGridListAddRow ( mapGridList )
guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false )
end
addEventHandler( "sendMaps", getLocalPlayer(), sendmaps )
addEvent( "clearGridList", true )
function clearGridList()
guiGridListClear( mapGridList )
end
addEventHandler( "clearGridList", getLocalPlayer(), clearGridList )
|