Ir para conteúdo

Featured Replies

Postado

seguinte, o sistema não funciona em tutores, tipo, quando eles viram o TOP Level e depois relogam, o efeito não funfa mais, e tbm o sistema funciona em GM, CM e ADM, e ai fica ruim, alguém pode me ajudar?

  • Respostas 60
  • Visualizações 11.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • claro, esse código que fiz não é para TFS 1.0 ou TFS 1.1   vou fazer outro código com essa versão assim que tiver tempo

  • local config = { tempo = 5, --tempo em segundos mensagem = { texto = "[TOP]", --não use mais de 9 caracteres efeito = TEXTCOLOR_LIGHTBLUE --efeito para a função doSendAnimatedText }, efeito =

  • Teria como eu colocar para o TOP ML ?   ---- Ficaria como?

Postado
local config = {
	tempo = 5, --tempo em segundos
	mensagem = {
		texto = "[TOP]", --não use mais de 9 caracteres
		efeito = TEXTCOLOR_LIGHTBLUE --efeito para a função doSendAnimatedText
	},
	efeito = 30, --efeito da função doSendMagicEffect
	globalstr = 150202 -- uma global storage qualquer q esteje vazia
}
function TopEffect(cid)
	local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
	if not isCreature(cid) or getPlayerName(cid) ~= var[1] then return LUA_ERROR end
	doSendAnimatedText(getCreaturePosition(cid), config.mensagem.texto, config.mensagem.efeito)
	doSendMagicEffect(getCreaturePosition(cid), config.efeito)
	addEvent(TopEffect, config.tempo*1000, cid)
end
function onLogin(cid)
	if tonumber(getGlobalStorageValue(config.globalstr)) then -- virgin
		local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1")
		if (query:getID() ~= -1) then
			setGlobalStorageValue(config.globalstr, ":"..query:getDataString("name")..",:"..query:getDataInt("level"))
			TopEffect(cid)
		end
	else
		TopEffect(cid)
	end
	registerCreatureEvent(cid, "CheckTop")
	return true
end
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill ~= SKILL__LEVEL then return true end
	local var = tostring(getGlobalStorageValue(config.globalstr)):gsub(':', ''):explode(',')
	if newLevel > tonumber(var[2]) and getPlayerName(cid) ~= var[1] then
		doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22)
		setGlobalStorageValue(config.globalstr, ":"..getPlayerName(cid)..",:"..newLevel)
		TopEffect(cid)
	end			
	return true
end

 

vodkart_logo.png

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

 

DISCORDvodkart#6090

 

  • 5 months later...
  • 2 weeks later...
  • 1 month later...

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