ABu-ALi_ Posted March 6, 2011 Posted March 6, 2011 hi all i want , If the player select the name of the map shows the name of the map in edit i try but not working this code client : mapGridList = guiCreateGridList(7,12,183,270,false,tab6) mapsColumn = guiGridListAddColumn(mapGridList,"Maps List",0.85) guiGridListSetSelectionMode(mapGridList,2) mapNameEdit = guiCreateEdit(280,25,140,29,"",false,tab6) guiEditSetReadOnly(mapNameEdit,5) and: addEvent("sendMaps", true ) function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) end addEventHandler( "sendMaps", getLocalPlayer(), sendmaps, set ) function set ( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText ( mapNameEdit, gridMapName ) end please help me
Castillo Posted March 6, 2011 Posted March 6, 2011 function set ( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText ( mapNameEdit, tostring(gridMapName) ) end Try it.
Moderators Citizen Posted March 6, 2011 Moderators Posted March 6, 2011 You can't make that: addEventHandler( "sendMaps", getLocalPlayer(), sendmaps, set ) See this page before you use it and you need this: https://wiki.multitheftauto.com/wiki/OnClientGUIClick Then try this and don't use existing function like set() (this is a lua function ): mapGridList = guiCreateGridList(7,12,183,270,false,tab6) mapsColumn = guiGridListAddColumn(mapGridList,"Maps List",0.85) guiGridListSetSelectionMode(mapGridList,2) mapNameEdit = guiCreateEdit(280,25,140,29,"",false,tab6) guiEditSetReadOnly(mapNameEdit,5) addEvent("sendMaps", true ) function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) end addEventHandler( "sendMaps", getLocalPlayer(), sendmaps ) function set1( ) selectedRow, selectedCol = guiGridListGetSelectedItem( mapGridList ) gridMapName = guiGridListGetItemText( mapGridList, selectedRow, selectedCol ) guiSetText( mapNameEdit, gridMapName ) end addEventHandler( "onClientGUIClick", mapGridList, set1 ) Except that, it works perfectly
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