Ahmed_Negm Posted September 29, 2016 Share Posted September 29, 2016 البحث مش شغال فين المشكلة الجريد ليست function buildPlayerList() grdPlayers = guiCreateGridList(0.0991,0.3417,0.8108,0.6, true, wndPlayers) search = guiCreateEdit(22, 84, 180, 32, "", false, wndPlayers) colPlayers = guiGridListAddColumn(grdPlayers, "Player list", 0.85) local players = getElementsByType("player") for k,v in ipairs(players) do addPlayerToList(v) end end addEventHandler("onClientResourceStart", root, buildPlayerList) فنكشن البحث addEventHandler("onClientGUIChanged", root, function () if ( source == Search ) then if ( guiGetText ( source ) == "" ) then guiGridListClear(grdPlayers) putPlayers (1) else guiGridListClear(grdPlayers) for i,v in ipairs(getElementsByType("player")) do if string.find(getPlayerName(v),guiGetText(Search)) then local row = guiGridListAddRow(grdPlayers) guiGridListSetItemText(grdPlayers,row,1,getPlayerName(v):gsub("#%x%x%x%x%x%x", ""),false,false) end end end end end ) ياريت تردو Link to comment
iPrestege Posted September 29, 2016 Share Posted September 29, 2016 addEventHandler ( 'onClientGUIChanged',Search, function ( ) guiGridListClear ( grdPlayers ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do if string.find ( string.upper ( getPlayerName ( v ):gsub ( '#%x%x%x%x%x%x', '' ) ),string.upper ( Search ) ) then guiGridListSetItemText ( grdPlayers,guiGridListAddRow ( grdPlayers ) ,1,getPlayerName ( v ):gsub('#%x%x%x%x%x%x', ''),false,false ) end end end,false ) لم يتم التجربة ورجاءاً استخدم الايديتور للاكواد اذا طرحتها . 2 Link to comment
Ahmed_Negm Posted September 29, 2016 Author Share Posted September 29, 2016 1 hour ago, Mr.Pres[T]ege said: addEventHandler ( 'onClientGUIChanged',Search, function ( ) guiGridListClear ( grdPlayers ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do if string.find ( string.upper ( getPlayerName ( v ):gsub ( '#%x%x%x%x%x%x', '' ) ),string.upper ( Search ) ) then guiGridListSetItemText ( grdPlayers,guiGridListAddRow ( grdPlayers ) ,1,getPlayerName ( v ):gsub('#%x%x%x%x%x%x', ''),false,false ) end end end,false ) لم يتم التجربة ورجاءاً استخدم الايديتور للاكواد اذا طرحتها . لا مش شغال برضوا Link to comment
iPrestege Posted September 30, 2016 Share Posted September 30, 2016 اطرح الكود كامل واستخدم Lua والـ ديبوج سكربت يقول شيء؟ Link to comment
iMr ~ MnHmAr Posted September 30, 2016 Share Posted September 30, 2016 اخوي عندك خطا بي كلمة Search شوف search = guiCreateEdit(22, 84, 180, 32, "", false, wndPlayers) هنا حاطها سمول و هنا كبتل if ( source == Search ) then جرب ذا function buildPlayerList() grdPlayers = guiCreateGridList(0.0991,0.3417,0.8108,0.6, true, wndPlayers) search = guiCreateEdit(22, 84, 180, 32, "", false, wndPlayers) colPlayers = guiGridListAddColumn(grdPlayers, "Player list", 0.85) local players = getElementsByType("player") for k,v in ipairs(players) do addPlayerToList(v) end end addEventHandler("onClientResourceStart", root, buildPlayerList) addEventHandler ( 'onClientGUIChanged',search, function ( ) guiGridListClear ( grdPlayers ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do if string.find ( string.upper ( getPlayerName ( v ):gsub ( '#%x%x%x%x%x%x', '' ) ),string.upper ( search ) ) then guiGridListSetItemText ( grdPlayers,guiGridListAddRow ( grdPlayers ) ,1,getPlayerName ( v ):gsub('#%x%x%x%x%x%x', ''),false,false ) end end end,false ) Link to comment
TAPL Posted October 2, 2016 Share Posted October 2, 2016 الرجاء عدم فتح اكثر من موضوع لنفس الكود Link to comment
Recommended Posts