momar5600 Posted September 24, 2016 Share Posted September 24, 2016 سلام عليكم ورحمة الله وبركاتة انا عملت مكان للبحث بلوحة الانتقال الي لاعب بس مانجح ماهو سبب addEventHandler("onClientResourceStart",resourceRoot, function() guiGridListSetSelectionMode( getControl( wndWarp, 'playerlist' ),2) local column = guiGridListAddColumn( getControl( wndWarp, 'playerlist' ), "Player Name", 0.89 ) if ( column ) then for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( getControl( wndWarp, 'playerlist' ) ) guiGridListSetItemText ( getControl( wndWarp, 'playerlist' ), row, column, getPlayerName(player), false, false ) guiGridListSetItemColor ( getControl( wndWarp, 'playerlist' ), row, column, 0, 250, 154, 255 ) end addEventHandler ( "onClientGUIClick", playerlist, click ) end end) function click () local playerName = guiGridListGetItemText ( getControl( wndWarp, 'playerlist' ), guiGridListGetSelectedItem ( playerlist ), 1 ) guiSetText ( getControl( wndWarp, '~|بحث عن لاعب|~' ), playerName ) end function list() guiGridListClear( getControl( wndWarp, 'playerlist' ) ) for id, players in ipairs (getElementsByType("player")) do local row = guiGridListAddRow( getControl( wndWarp, 'playerlist' ) ) guiGridListSetItemText( getControl( wndWarp, 'playerlist' ), row, 1, getPlayerName(players), false, false) guiGridListSetItemColor ( getControl( wndWarp, 'playerlist' ), row, 1, 0, 250, 154, 255 ) end end addEventHandler("onClientPlayerJoin", getRootElement(), list) addEventHandler("onClientPlayerQuit", getRootElement(), list) addEventHandler("onClientPlayerChangeNick", getRootElement(), list) wndWarp = { 'wnd', text = 'الانتقال الى الاعبين', width = 246, controls = { { 'lst', id='playerlist', width=231, x = 5, y= 62, height=343, columns={ {id='sharplayercol', text='الاعب', attr='name'} }, onitemdoubleclick=warpTo }, {'br'}, {'txt', id='sharplayer', text='~|بحث عن لاعب|~', onclick=click , x = 16, y= 23 ,width = 222}, {'br'}, {'btn', id='انتقال', onclick=warpTo}, {'btn', id='اغلاق', closeswindow=true} }, oncreate = warpInit } 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