GAME_OVER!! Posted August 4, 2012 Share Posted August 4, 2012 بسم الله الرحمن الرحيم السلام عليكم ورحمة الله وبركاته اخواني اانا بحثت بالويكي مالقيت شرح لل searchplayers مثلا انا بسوي شوب وبحط تحت فراغ Editor حلو وابغى بحث عن الاعبين انا دورته مالقيته بالويكي ان شاء الله فهمتو ومشكورين مقدماُ Link to comment
top sniper Posted August 4, 2012 Share Posted August 4, 2012 بسم الله الرحمن الرحيمالسلام عليكم ورحمة الله وبركاته اخواني اانا بحثت بالويكي مالقيت شرح لل searchplayers مثلا انا بسوي شوب وبحط تحت فراغ Editor حلو وابغى بحث عن الاعبين انا دورته مالقيته بالويكي ان شاء الله فهمتو ومشكورين مقدماُ string.find http://www.lua.org/pil/20.1.html Link to comment
UAEpro Posted August 4, 2012 Share Posted August 4, 2012 (edited) function createPlayerList () --عمل جدول اللاعبين local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) --عمل عمود لاسماء اللاعبين local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do --- البحث عن جميع اللاعبين local row = guiGridListAddRow ( playerList ) -- اضافة سطر جديد guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) -- وضع اسم اللاعب بالسطر end end end المصدر https://wiki.multitheftauto.com/wiki/GuiCreateGridList Edited August 4, 2012 by Guest Link to comment
Booo Posted August 4, 2012 Share Posted August 4, 2012 addEventHandler("onClientResourceStart",resourceRoot, function () theWindow = guiCreateWindow(240, 200, 550, 330, "", false) searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) guiGridListAddColumn(playersList,"Player name:",0.90) for index, player in ipairs(getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) end end ) function findPlayers () guiGridListClear( playersList ) local text = guiGetText ( source ) if (text ~= "") then for index, player in ipairs (getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) else guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) break end end else for index, player in ipairs (getElementsByType("player")) do local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) end end end Link to comment
GAME_OVER!! Posted August 4, 2012 Author Share Posted August 4, 2012 بسم الله الرحمن الرحيمالسلام عليكم ورحمة الله وبركاته اخواني اانا بحثت بالويكي مالقيت شرح لل searchplayers مثلا انا بسوي شوب وبحط تحت فراغ Editor حلو وابغى بحث عن الاعبين انا دورته مالقيته بالويكي ان شاء الله فهمتو ومشكورين مقدماُ string.find http://www.lua.org/pil/20.1.html انا مادري كيف تفهمون حق هاذي الصفحات انا ابدآً مو عارف ياريت تشرحلي شيء بسيط منها او تفهمني كيف افهم منها مو داخله عقلي ابد Link to comment
GAME_OVER!! Posted August 4, 2012 Author Share Posted August 4, 2012 function createPlayerList () --عمل جدول اللاعبين local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) --عمل عمود لاسماء اللاعبين local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do --- البحث عن جميع اللاعبين local row = guiGridListAddRow ( playerList ) -- اضافة سطر جديد guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) -- وضع اسم اللاعب بالسطر end end end المصدر https://wiki.multitheftauto.com/wiki/GuiCreateGridList اخوي وين البحث؟؟ Link to comment
GAME_OVER!! Posted August 4, 2012 Author Share Posted August 4, 2012 addEventHandler("onClientResourceStart",resourceRoot, function () theWindow = guiCreateWindow(240, 200, 550, 330, "", false) searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) guiGridListAddColumn(playersList,"Player name:",0.90) for index, player in ipairs(getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) end end ) function findPlayers () guiGridListClear( playersList ) local text = guiGetText ( source ) if (text ~= "") then for index, player in ipairs (getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) else guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) break end end else for index, player in ipairs (getElementsByType("player")) do local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) end end end مشكور ماقصرت جاري التجربه Link to comment
Tete omar Posted August 4, 2012 Share Posted August 4, 2012 اذا تبي تسوي edit تبحث عن الاعبين في ال gridlist مثل في لوحة الأدمن, استخدم onClientGUIChanged Link to comment
#[swat]Alooy Posted August 5, 2012 Share Posted August 5, 2012 addEventHandler("onClientResourceStart",resourceRoot, function () theWindow = guiCreateWindow(240, 200, 550, 330, "", false) searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) guiGridListAddColumn(playersList,"Player name:",0.90) for index, player in ipairs(getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) end end ) function findPlayers () guiGridListClear( playersList ) local text = guiGetText ( source ) if (text ~= "") then for index, player in ipairs (getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) else guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) break end end else for index, player in ipairs (getElementsByType("player")) do local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) end end end Link to comment
3NAD Posted August 5, 2012 Share Posted August 5, 2012 addEventHandler("onClientResourceStart",resourceRoot, function () theWindow = guiCreateWindow(240, 200, 550, 330, "", false) searchPlayer = guiCreateEdit(15, 25, 180, 20, "",false, theWindow) addEventHandler ("onClientGUIChanged", searchPlayer, findPlayers, false) playersList = guiCreateGridList(10, 50, 500, 210, false, theWindow) guiGridListAddColumn(playersList,"Player name:",0.90) for index, player in ipairs(getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, getPlayerName(player):gsub("#%x%x%x%x%x%x", ""), false, false) end end ) function findPlayers () guiGridListClear( playersList ) local text = guiGetText ( source ) if (text ~= "") then for index, player in ipairs (getElementsByType("player")) do local playerRow = guiGridListAddRow(playersList) local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") if ( string.find ( string.upper ( playerName ), string.upper ( text ), 1, true ) ) then guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) else guiGridListSetItemText(playersList, playerRow, 1, "No player found.", false, false) break end end else for index, player in ipairs (getElementsByType("player")) do local playerName = getPlayerName(player):gsub("#%x%x%x%x%x%x", "") local playerRow = guiGridListAddRow(playersList) guiGridListSetItemText(playersList, playerRow, 1, playerName, false, false) end end end وشش الجديد عن ككود بسول ؟ 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