Jump to content

procurar jogador


Recommended Posts

Bom dia,

estou com dificuldade na minha grilist eu coloco pra escrever o nome do jogador no  guiGetText   so que ele nao aparece na grilist mais quando eu apago ela funciona

 

a função de quando apaga o texto funciona, mais a que procura o nome do jogador nao.


function editAddPlayer()
	guiGridListClear(BGUIGridlist3)
	local text = guiGetText ( source )
	if ( text == "" ) then
		guiGridListClear ( BGUIGridlist3 ) 
		for id,player in ipairs(getElementsByType("player")) do
	    	local NamePlayer = getPlayerName(player):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','')
				local row = guiGridListAddRow ( BGUIGridlist3 )
				guiGridListSetItemText ( BGUIGridlist3, row, BavailablePlayesColumn,NamePlayer, false, false )
				guiGridListSetItemText ( BGUIGridlist3, row, BavailablePlayesColumn2,getElementData(player,"BaseAccountName"), false, false )
				outputChatBox("1")
		end
	else
		guiGridListClear ( BGUIGridlist3 ) 
		for id,player in ipairs(getElementsByType("player")) do
			local NamePlayer = getPlayerName(player):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','')
			if ( string.find ( string.upper ( tostring(NamePlayer) ), string.upper ( text ), 1, true ) ) then
				local row = guiGridListAddRow ( BGUIGridlist3 )
				guiGridListSetItemText ( BGUIGridlist3, row, BavailablePlayesColumn,NamePlayer, false, false )
				guiGridListSetItemText ( BGUIGridlist3, row, BavailablePlayesColumn2,getElementData(player,"BaseAccountName"), false, false )
			end
		end
		guiGridListClear(BGUIGridlist3)
	end
end

 

Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...