function putPlayers()
guiGridListClear(GRID)
for i,player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(GRID)
guiGridListSetItemText(GRID,row,1,getPlayerName(player),false,false)
guiGridListSetItemText(GRID,row,2,getPlayerMoney(player),false,false)
end
end
addEventHandler("onClientGUIChanged",root,
function ()
if ( source == Search_edit ) then
local text = string.upper(guiGetText(Search_edit))
if ( text == "" ) then
putPlayers()
else
guiGridListClear(GRID)
for i,v in ipairs(getElementsByType("player")) do
local name = string.upper(getPlayerName(v))
if string.find(name,text) then
playSoundFrontEnd(3)
local row = guiGridListAddRow(GRID)
guiGridListSetItemText(GRID,row,1,getPlayerName(v),false,false)
guiGridListSetItemText(GRID,row,2,getPlayerMoney(player),false,false)
end
end
end
end
end
)
جرب ورد خبر