Ir para conteúdo

Featured Replies

Postado

Galera queria um script que desse acesso a God pra ver e remove item do inventario de um play com esse comando.

 

Ex : /Espionar "nome do play"

Jamais se desespere em meio as sombrias afeiçoes da sua vida, pois das nuvens mais negras cai água límpida e fecunda

Postado



<talkaction log="yes" words="!find;/find" access="5" event="script" value="finditem.lua"/>

 

/find item name

 

function onSay(cid, words, param)
	if param == '' or tonumber(param) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "/find item name")
		return true
	end
	local item_id = getItemIdByName(tostring(param), false) 
	if not item_id then
		doPlayerSendCancel(cid, "This item does not exist.") return true
	end
	local str, player_depotitems, players_items, tile_items = "",{},{},{}
	local dp = db.getResult("SELECT `player_id`, `count` FROM `player_depotitems` WHERE `itemtype` = "..item_id),{}
	if (dp:getID() ~= -1) then
		repeat
			player_depotitems[#player_depotitems+1] = {dp:getDataInt("player_id"), dp:getDataInt("count") }
		until not(dp:next())
		dp:free()
	end
	local pi = db.getResult("SELECT `player_id`, `count` FROM `player_items` WHERE `itemtype` = "..item_id),{}
	if (pi:getID() ~= -1) then
		repeat
			players_items[#players_items+1] = {pi:getDataInt("player_id"), pi:getDataInt("count") }
		until not(pi:next())
		pi:free()
	end
	local hi = db.getResult("SELECT `tile_id`, `count` FROM `tile_items` WHERE `itemtype` = "..item_id),{}
	if (hi:getID() ~= -1) then
		repeat
			local tile = db.getResult("SELECT `house_id`, `x`, `y`, `z` FROM `tiles` WHERE `id` = "..hi:getDataInt("tile_id")),{}
			tile_items[#tile_items+1] = {tile:getDataInt("house_id"),tile:getDataInt("x"),tile:getDataInt("y"),tile:getDataInt("z")}
		until not(hi:next())
		hi:free()
	end	 
	if #player_depotitems > 0 then
		str = str .. "#DEPOT ITEMS#\nQuantidade - Jogador\n"
		for i = 1, table.maxn(player_depotitems) do
			str = str .. player_depotitems[i][2] .. ' ' .. getPlayerNameByGUID(player_depotitems[i][1]) ..' \n'
		end
	end
	if #players_items > 0 then
		str = str .. (str ~= "" and "--------------//-------------\n\n#PLAYER ITEMS#\nQuantidade - Jogador\n" or "#PLAYER ITEMS#\nQuantidade - Jogador\n") 
		for i = 1, table.maxn(players_items) do
			str = str .. players_items[i][2] .. ' ' .. getPlayerNameByGUID(players_items[i][1]) ..' \n'
		end
	end
	if #tile_items > 0 then
		str = str .. (str ~= "" and "--------------//-------------\n\n#TILE ITEMS#\nHouse ID - Tile Position\n" or "#TILE ITEMS#\nHouse ID -Tile Position\n") 
		for i = 1, table.maxn(tile_items) do
			str = str .. tile_items[i][1] .. ' - {x = ' .. tile_items[i][2] ..', y = ' .. tile_items[i][3] ..', z = ' .. tile_items[i][4] ..'} \n'
		end
	end
	return doShowTextDialog(cid,item_id, str)
end

 

Scriptszinhos:

 

Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.

  • 1 year later...
Postado
Em 12/05/2017 em 03:41, pablobion disse:



<talkaction log="yes" words="!find;/find" access="5" event="script" value="finditem.lua"/>

  

/find item name

 


function onSay(cid, words, param)
	if param == '' or tonumber(param) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "/find item name")
		return true
	end
	local item_id = getItemIdByName(tostring(param), false) 
	if not item_id then
		doPlayerSendCancel(cid, "This item does not exist.") return true
	end
	local str, player_depotitems, players_items, tile_items = "",{},{},{}
	local dp = db.getResult("SELECT `player_id`, `count` FROM `player_depotitems` WHERE `itemtype` = "..item_id),{}
	if (dp:getID() ~= -1) then
		repeat
			player_depotitems[#player_depotitems+1] = {dp:getDataInt("player_id"), dp:getDataInt("count") }
		until not(dp:next())
		dp:free()
	end
	local pi = db.getResult("SELECT `player_id`, `count` FROM `player_items` WHERE `itemtype` = "..item_id),{}
	if (pi:getID() ~= -1) then
		repeat
			players_items[#players_items+1] = {pi:getDataInt("player_id"), pi:getDataInt("count") }
		until not(pi:next())
		pi:free()
	end
	local hi = db.getResult("SELECT `tile_id`, `count` FROM `tile_items` WHERE `itemtype` = "..item_id),{}
	if (hi:getID() ~= -1) then
		repeat
			local tile = db.getResult("SELECT `house_id`, `x`, `y`, `z` FROM `tiles` WHERE `id` = "..hi:getDataInt("tile_id")),{}
			tile_items[#tile_items+1] = {tile:getDataInt("house_id"),tile:getDataInt("x"),tile:getDataInt("y"),tile:getDataInt("z")}
		until not(hi:next())
		hi:free()
	end	 
	if #player_depotitems > 0 then
		str = str .. "#DEPOT ITEMS#\nQuantidade - Jogador\n"
		for i = 1, table.maxn(player_depotitems) do
			str = str .. player_depotitems[i][2] .. ' ' .. getPlayerNameByGUID(player_depotitems[i][1]) ..' \n'
		end
	end
	if #players_items > 0 then
		str = str .. (str ~= "" and "--------------//-------------\n\n#PLAYER ITEMS#\nQuantidade - Jogador\n" or "#PLAYER ITEMS#\nQuantidade - Jogador\n") 
		for i = 1, table.maxn(players_items) do
			str = str .. players_items[i][2] .. ' ' .. getPlayerNameByGUID(players_items[i][1]) ..' \n'
		end
	end
	if #tile_items > 0 then
		str = str .. (str ~= "" and "--------------//-------------\n\n#TILE ITEMS#\nHouse ID - Tile Position\n" or "#TILE ITEMS#\nHouse ID -Tile Position\n") 
		for i = 1, table.maxn(tile_items) do
			str = str .. tile_items[i][1] .. ' - {x = ' .. tile_items[i][2] ..', y = ' .. tile_items[i][3] ..', z = ' .. tile_items[i][4] ..'} \n'
		end
	end
	return doShowTextDialog(cid,item_id, str)
end

 

como funciona esse /find ? ele verifica o item ou verifica o player? testei /findo nome do player e deu item inexistente , tentei /find id do item e deu msm coisa item inexistente kk 

 

Postado

@sidneivascao

 

"/find id, nome do player"

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo