☠ RaZeR ☠ Posted July 26, 2016 Share Posted July 26, 2016 hi i want to remove the hex code from Warp Panel in the Freeroam fr_client function warpInit() local players = table.map(getElementsByType('player'), function(p) return { name = getPlayerName(p) } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) local gui = getControl(wndWarp, 'search') addEventHandler ( "onClientGUIChanged", gui, findPlayer, false ) end function findPlayer () local text = guiGetText ( source ) if (text == "") then local players = table.map(getElementsByType('player'), function(p) return { name = getPlayerName(p) } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) return end local matches = {} for index, playeritem in ipairs (getElementsByType("player")) do if ( string.find ( string.upper ( getPlayerName ( playeritem ) ), string.upper ( text ), 1, true ) ) then table.insert(matches, playeritem) end end local players = table.map(matches, function(p) return { name = getPlayerName(p) } end) table.sort(players, function(a, b) return a.name < b.name end) bindGridListToTable(wndWarp, 'playerlist', players, true) end Link to comment
John Smith Posted July 26, 2016 Share Posted July 26, 2016 Replace all instances of: getPlayerName(p) with: string.gsub(getPlayerName(p), "#%x%x%x%x%x%x", "") 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