Newbie Posted April 29, 2014 Share Posted April 29, 2014 Here's how gridlist looks: http://i.imgur.com/cdJ7Zhj.png Is there any way to hide or edit shroll bar of gridlist ? and i need to show maps as a name's from meta and not as a resources name. mapGridList = guiCreateGridList(x/3.6, y/3.0, 417, 275, false) mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85) guiGridListSetSelectionMode(mapGridList,1) 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 ) Link to comment
tosfera Posted April 29, 2014 Share Posted April 29, 2014 Can you post the server sided function; 'sendMaps' ? Link to comment
Newbie Posted April 29, 2014 Author Share Posted April 29, 2014 Can you post the server sided function; 'sendMaps' ? Sure function mapsList() local resourceTable = getResources() triggerClientEvent ( "clearGridList", getRootElement() ) for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) local type1 = getResourceInfo ( resourceValue, "type" ) local gamemode1 = getResourceInfo ( resourceValue, "gamemodes" ) if type1 == "map" and gamemode1 == "race" then triggerClientEvent ( "sendMaps", getRootElement(), name) else cancelEvent() end end end addCommandHandler( "sendMaps", mapsList, false, false ) addEventHandler("onPostFinish",getRootElement(),mapsList) Link to comment
tosfera Posted April 29, 2014 Share Posted April 29, 2014 well, replace this line; local name = getResourceName(resourceValue) with this one; local name = getResourceInfo ( resourceValue, "Name" ) make sure that you include a 'name' attribute ine very map. Link to comment
Newbie Posted April 29, 2014 Author Share Posted April 29, 2014 Oh Thanks. How can i edit GridList scroll box ? Or even hide it ? (better way) Link to comment
Mr_Moose Posted April 30, 2014 Share Posted April 30, 2014 Not sure if you can hide scrollbars since they seem to appear automatically on overflow, but you may try this function: https://wiki.multitheftauto.com/wiki/GuiSetProperty Link to comment
Tete omar Posted April 30, 2014 Share Posted April 30, 2014 I don't think you can hide it, even by using a GUI property, but if you really need to hide it, you can make your own custom gridlist using dx-functions, but it wouldn't be that easy since it needs a lot of math and scripting professionalization to produce the best customized gridlist. Link to comment
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