Ir para conteúdo
  • Cadastre-se

Action%2525252525252525252FTalkaction [Funcional] Talkaction !rank [Personalizado]


Posts Recomendados

Creditos: Critico (vodkart)

Comando !rank atualizado com novo rank que é o !rank frags, onde mostra os maiores matadores do ot.

Ranks:

Skills

Level

Magic

Health

Mana

Frags

Exemplo:

!rank frags

!rank magic

Crie ranks.lua em data/talkactions/scripts.

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",

['mana'] = "manamax"

},

vocations = {

['sorcerer'] = {1,5},

['druid'] = {2,6},

['paladin'] = {3,7},

['knight'] = {4,8}

},

storages = {

['frags'] = 824544

}

}

function onSay(cid, words, param)

local store,exausted = 156201,30

local param,str = string.lower(param),""

if not config.fight_skills[param] and not config.other_skills[param] and not config.vocations[param] and not config.storages[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"

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 config.storages[param] and db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..config.storages[param].." ORDER BY cast(value as INTEGER) DESC;") 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

while true do

str = str .. "\n " .. k .. ". "..(config.fight_skills[param] and getPlayerNameByGUID(query:getDataString("player_id")) or config.storages[param] and getPlayerNameByGUID(query:getDataString("player_id")) or query:getDataString("name")).." - [" .. query:getDataInt((config.fight_skills[param] and "value" or config.storages[param] and "value" or config.vocations[param] and "level" or config.other_skills[param])) .. "]"

k = k + 1

if not(query:next()) or k > config.MaxPlayer then

break

end

end

query:free()

end

doShowTextDialog(cid,6500, str)

setPlayerStorageValue(cid, store, os.time()+exausted)

return true

end

Em data/lib/050-function.lua adicione:

function setFrags(cid)

if not isCreature(cid) then return LUA_ERROR end

setPlayerStorageValue(cid, 824544, getPlayerFrags(cid))

return doPlayerSave(cid)

end

Crie rankfrags.lua em data/creaturescripts/scripts

function onKill(cid, target, lastHit)

if isPlayer(cid) and isPlayer(target) then

addEvent(setFrags, 1, cid)

end

return true

end

E em data/creaturescripts/login.lua adicione:

registerCreatureEvent(cid, "Rankfrags")

setFrags(cid)

Simples e Útil :)

Se ajudei REP+

Editado por AnneMotta (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Copiando coisa e nao pondo créditos em safado! Créditos by Vodkar:

(aki o spoiler caso vc altere alguma coisa e fale que eu estou inventando)

Comando !rank atualizado com novo rank que é o !rank frags, onde mostra os maiores matadores do ot.

Ranks:

Skills

Level

Magic

Health

Mana

Frags

Exemplo:

!rank frags

!rank magic

Crie ranks.lua em data/talkactions/scripts.

Em data/lib/050-function.lua adicione:

Crie rankfrags.lua em data/creaturescripts/scripts

E em data/creaturescripts/login.lua adicione:

Simples e Útil :)

Se ajudei REP+

Editado por Gustavo Ferreira (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

vamos la, Warwolf peço que coloque os créditos do devido criador do script.

1579091 - tire o link do outro fórum e outra não é necessário chamar alguém de safado para corrigir um erro.

16/11/2014

23/11/2014

 

RIP AnneMotta 21/01/2012 - 15/01/2014

Liga das lendas: DIAMOND É A META

6qpqBbJ.png

Link para o post
Compartilhar em outros sites

@Post Editado, 1579091 Favor mais educação, Não precisa chingar para o membro arrumar o post!

Mais 1 vez que te pegar ofendendo outro membro estarei te punindo!

Link para o post
Compartilhar em outros sites

"critico" é a minha conta na otland, então já que está com os créditos não tem problema...

rep+

vodkart_logo.png

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

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • 2 years later...
  • 2 months 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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo