Ir para conteúdo

Featured Replies

Postado
  • Solução
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

 

  • Respostas 16
  • Visualizações 727
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = { MaxPlayer = 20, fight_skills = { ['fist'] = 0, ['club'] = 1, ['sword'] = 2, ['axe'] = 3, ['distance'] = 4, ['shielding'] = 5, ['fishing'] = 6, ['dist'] = 4, ['shie

Posted Images

Postado
  • Autor
  Em 01/04/2017 em 02:43, Vodkart disse:

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

 

 

Mano, você vai ficar bravo, mas ainda não funcionou, wtf?

 

Sera que é minha database? Sera que por mod fumfa? '-'

 

 

wtf.png

Postado
  • Autor

@Vodkart, amigo, descobri o problema, como eu pensava... era a database mesmo, acabei colocando outra de um ot server, porém ela  esta bem poluída (cheia de informações), existe algum query que faz uma limpeza de todos os dados contido? Tem outra solução também, que não sei, mas podemos criar a tabela que falta na minha database que esta limpa, só não sei qual database é agora...

 

Siga abaixo as imagens da database que eu peguei, e a minha de origem.

 

database que eu peguei:

 

bestbaiak.s3dbUnavailable

 

a minha de origem:

 

theforgottenserver.s3dbUnavailable

 

1.png

2.png

minha database origem.png

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