Jump to content

map name in edit..help me please


ABu-ALi_

Recommended Posts

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 :(

Link to comment
  • Moderators

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

Link to comment

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...