Ir para conteúdo

Featured Replies

Postado

Boa galera, alguém pode me ajudar a remover o account manager do rank? (Para não aparecer).

 

local config = {
	MaxPlayer = 20,
	fight_skills = {
		['fist'] = 0,
		['club'] = 1,
		['sword'] = 2,
		['axe'] = 3,
		['distance'] = 4,
		['shielding'] = 5,
		['fishing'] = 6,
		['dist'] = 4,
		['shield'] = 5,
		['fish'] = 6,
	},
	other_skills = {
		[''] = "level",
		['level'] = "level",
		['magic'] = "maglevel",
		['health'] = "healthmax",
		['reset'] = "reset",
		['mana'] = "manamax"
	},
	vocations = {
		['sorcerer'] = {1,5},
		['druid'] = {2,6},
		['paladin'] = {3,7},
		['knight'] = {4,8}
	}
}
function onSay(cid, words, param)
	local store,exausted = 156201,5
	local param,str = param:lower(),""
	if not config.fight_skills[param] and not config.other_skills[param] and not config.vocations[param] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "this ranking does not exists.") return true
	elseif getPlayerStorageValue(cid, store) >= os.time() then
		doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.") return true
	end
	str = "--[ RANK "..(param == "" and "LEVEL" or string.upper(param)).." ]--\n\n"
	local query = config.fight_skills[param] and db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..config.fight_skills[param].." ORDER BY `value` DESC;") or config.other_skills[param] and db.getResult("SELECT `name`, `"..config.other_skills[param].."` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `"..config.other_skills[param].."` DESC, `name` ASC;") or db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` <= 2 AND `vocation` = "..config.vocations[param][1].." or `vocation` = "..config.vocations[param][2].." ORDER BY `level` DESC;")
	if (query:getID() ~= -1) then
		k = 1
		repeat
			str = str .. "\n " .. k .. ". "..(config.fight_skills[param] and getPlayerNameByGUID(query:getDataString("player_id")) or query:getDataString("name")).." - [" .. query:getDataInt((config.fight_skills[param] and "value" or config.vocations[param] and "level" or config.other_skills[param])) .. "]"
			k = k + 1
			until not(query:next()) or k > config.MaxPlayer
		query:free()
	end
	doShowTextDialog(cid,6500, str)
	setPlayerStorageValue(cid, store, os.time()+exausted)
	return true
end

 

Resolvido por Wakon

Ir para solução
Postado
  • Solução

Tente assim:

local config = {
	MaxPlayer = 20,
	fight_skills = {
		['fist'] = 0,
		['club'] = 1,
		['sword'] = 2,
		['axe'] = 3,
		['distance'] = 4,
		['shielding'] = 5,
		['fishing'] = 6,
		['dist'] = 4,
		['shield'] = 5,
		['fish'] = 6,
	},
	other_skills = {
		[''] = "level",
		['level'] = "level",
		['magic'] = "maglevel",
		['health'] = "healthmax",
		['reset'] = "reset",
		['mana'] = "manamax"
	},
	vocations = {
		['sorcerer'] = {1,5},
		['druid'] = {2,6},
		['paladin'] = {3,7},
		['knight'] = {4,8}
	}
}
function onSay(cid, words, param)
        local managerID = '8'
	local store,exausted = 156201,0
	local param,str = param:lower(),""
	if not config.fight_skills[param] and not config.other_skills[param] and not config.vocations[param] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "this ranking does not exists.") return true
	elseif getPlayerStorageValue(cid, store) >= os.time() then
		doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.") return true
	end
	str = "--[ RANK "..(param == "" and "LEVEL" or string.upper(param)).." ]--\n\n"
	local query = config.fight_skills[param] and db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..config.fight_skills[param].." AND `player_id` != ".. managerID .." ORDER BY `value` DESC;") or config.other_skills[param] and db.getResult("SELECT `name`, `"..config.other_skills[param].."` FROM `players` WHERE `id` > 6 AND `group_id` < 2 AND `id` != ".. managerID .." ORDER BY `"..config.other_skills[param].."` DESC, `name` ASC;") or db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` <= 2 AND `id` != ".. managerID .." AND `vocation` = "..config.vocations[param][1].." or `vocation` = "..config.vocations[param][2].." ORDER BY `level` DESC;")
	if (query:getID() ~= -1) then
		k = 1
		repeat
			str = str .. "\n " .. k .. ". "..(config.fight_skills[param] and getPlayerNameByGUID(query:getDataString("player_id")) or query:getDataString("name")).." - [" .. query:getDataInt((config.fight_skills[param] and "value" or config.vocations[param] and "level" or config.other_skills[param])) .. "]"
			k = k + 1
			until not(query:next()) or k > config.MaxPlayer
		query:free()
	end
	doShowTextDialog(cid,6500, str)
	setPlayerStorageValue(cid, store, os.time()+exausted)
	return true
end

Em managerID, coloque o id do Account Manager, você pode encontra-lo na database na seção "players".

Postado
local config = {
	MaxPlayer = 20,
	fight_skills = {
		['fist'] = 0,
		['club'] = 1,
		['sword'] = 2,
		['axe'] = 3,
		['distance'] = 4,
		['shielding'] = 5,
		['fishing'] = 6,
		['dist'] = 4,
		['shield'] = 5,
		['fish'] = 6,
	},
	other_skills = {
		[''] = "level",
		['level'] = "level",
		['magic'] = "maglevel",
		['health'] = "healthmax",
		['reset'] = "reset",
		['mana'] = "manamax"
	},
	vocations = {
		['sorcerer'] = {1,5},
		['druid'] = {2,6},
		['paladin'] = {3,7},
		['knight'] = {4,8}
	}
}
function onSay(cid, words, param)
	local store,exausted = 156201,5
	local param,str = param:lower(),""
	if not config.fight_skills[param] and not config.other_skills[param] and not config.vocations[param] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "this ranking does not exists.") return true
	elseif getPlayerStorageValue(cid, store) >= os.time() then
		doPlayerSendCancel(cid, "wait " .. getPlayerStorageValue(cid, store) - os.time() .. " seconds to use this command again.") return true
	end
	str = "--[ RANK "..(param == "" and "LEVEL" or string.upper(param)).." ]--\n\n"
	local query = config.fight_skills[param] and db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `player_id` > 6 AND `skillid` = "..config.fight_skills[param].." ORDER BY `value` DESC;") or config.other_skills[param] and db.getResult("SELECT `name`, `"..config.other_skills[param].."` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `"..config.other_skills[param].."` DESC, `name` ASC;") or db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` <= 2 AND `vocation` = "..config.vocations[param][1].." or `vocation` = "..config.vocations[param][2].." ORDER BY `level` DESC;")
	if (query:getID() ~= -1) then
		k = 1
		repeat
			str = str .. "\n " .. k .. ". "..(config.fight_skills[param] and getPlayerNameByGUID(query:getDataString("player_id")) or query:getDataString("name")).." - [" .. query:getDataInt((config.fight_skills[param] and "value" or config.vocations[param] and "level" or config.other_skills[param])) .. "]"
			k = k + 1
			until not(query:next()) or k > config.MaxPlayer
		query:free()
	end
	doShowTextDialog(cid,6500, str)
	setPlayerStorageValue(cid, store, os.time()+exausted)
	return true
end

 

 

eu acho que na database o account manager é id 6, se não for mude o 6 por 8 por exemplo

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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.7k

Informação Importante

Confirmação de Termo