البحث مش شغال
فين المشكلة
الجريد ليست
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
)
ياريت تردو