Ir para conteúdo

Featured Replies

Postado
  • Solução
local storage = 9999

function onUse(cid, item, frompos, item2, topos)
	local result = db.getResult("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;")
	if(result:getID() ~= -1) then
		local message = "Em memória de:\n\n"
		repeat
			local playerId = result:getDataInt("player_id")
			local database = db.getResult("SELECT `name` FROM `players` WHERE `id` = " .. db.escapeString(playerId) .. ";")
			if(database:getID() ~= -1) then
				local playerName = database:getDataString("name")
				message = ""..message.."".. playerName ..".\n"
				database:free()
			end
		until not(result:next())
		result:free()
		doPlayerPopupFYI(cid, message)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não existe nenhum nome gravado.")
	end

	return true
end

 

  • Respostas 7
  • Visualizações 666
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • luanluciano93
    luanluciano93

    local storage = 9999 function onUse(cid, item, frompos, item2, topos) local result = db.getResult("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;") if(res

  • luanluciano93
    luanluciano93

    local storage = 9999 function onUse(cid, item, frompos, item2, topos) local result = db.getResult("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;") if(res

Postado

@Thornes 

local storage = 9999
 
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local resultId = db.storeQuery("SELECT `player_id` FROM `player_storage` WHERE `key` = " .. storage .. " AND `value` = 1;")
    if resultId ~= false then
        local message = "Em memória de:\n\n"
        repeat
            local resultId2 = db.storeQuery("SELECT `name` FROM `players` WHERE `id` = " .. result.getDataInt(resultId, "player_id") .. ";")
            if resultId2 ~= false then
                local playerName = result.getString(resultId2, "name")
                message = ""..message.."".. playerName ..".\n"
                result.free(resultId2)
            end
        until not result.next(resultId)
        result.free(resultId)
        player:popupFYI(message)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Não existe nenhum nome gravado.")
    end
    return true
end

 

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