Ir para conteúdo

[Encerrado] Erro Talkactions !rank


Marcusbarbosa

Posts Recomendados

Boa noite, acabei de abrir um otserver(Emporia OTX Global), com isso eu tento colocar o talkactions do !ranks e não obtenho sucesso.E fica ruim neh, você jogar em um servidor que não da para ver o TOP LEVEL! Eu não sei se é o servidor que não aceita. Já testei de todos os modos, não dá em nenhum. Alguem pode me ajudar? saber o que esta acontecendo? ou se tem outro meio dos players verem o rank sem ser por site? Obrigado. Aguardo retorno.
Veja o Erro que dá:

[Error - Event::checkScript] Event onSay not found (data/talkactions/scripts/ranks.lua)
[Error - TalkAction Interface]
data/talkactions/scripts/ranks.lua:onSay
Description:
data/talkactions/scripts/ranks.lua:17: attempt to call global 'getHighscoreString' (a nil value)
stack traceback:
data/talkactions/scripts/ranks.lua:17: in function <data/talkactions/scripts/ranks.lua:1>

Link para o comentário
Compartilhar em outros sites

function onSay(cid, words, param)

local ranks = {

['fist'] = {0},

['club'] = {1},

['sword'] = {2},

['axe'] = {3},

['distance'] = {4},

['shield'] = {5},

['fish'] = {6},

['magic'] = {7},

['level'] = {8},

}

local msg = string.lower(param)

if ranks[msg] ~= nil then

str = getHighscoreString((ranks[msg][1]))

else

str = getHighscoreString((8))

end

doShowTextDialog(cid,6500, str)

return TRUE

end

 

 

<?xml version="1.0" encoding="UTF-8"?>

<talkactions>
<!-- Gods -->
<talkaction log="yes" words="/skill;/addskill" access="3" event="script" value="skill.lua"/>
<talkaction log="yes" words="/attr" access="3" event="function" value="thingProporties"/>
<talkaction log="yes" words="/serverdiag" access="3" event="function" value="diagnostics"/>
<talkaction log="yes" words="/closeserver" access="3" event="script" value="closeopen.lua"/>
<talkaction log="yes" words="/openserver" access="3" event="script" value="closeopen.lua"/>
<talkaction log="yes" words="/promote;/demote" access="3" event="script" value="promote.lua"/>
<talkaction log="yes" words="/shutdown" access="3" event="script" value="shutdown.lua"/>
<talkaction log="yes" words="/mode" access="3" event="script" value="mode.lua"/>
<!-- Community Managers -->
<talkaction log="yes" words="/s" access="3" event="script" value="summon.lua"/>
<talkaction log="yes" words="/n" access="3" event="script" value="creature.lua"/>
<talkaction log="yes" words="/m" access="3" event="script" value="creature.lua"/>
<talkaction log="yes" words="/reload" access="3" event="script" value="reload.lua"/>
<talkaction log="yes" words="/raid" access="3" event="script" value="raid.lua"/>
<talkaction log="yes" words="/newtype" access="3" event="script" value="newtype.lua"/>
<talkaction log="yes" words="/r" access="3" event="script" value="remove.lua"/>
<talkaction log="yes" words="/owner" access="3" event="script" value="owner.lua"/>
<talkaction log="yes" words="/storage" access="3" event="script" value="storage.lua"/>
<talkaction log="yes" words="/i" access="3" event="script" value="createitem.lua"/>
<talkaction log="yes" words="/bc" access="3" event="script" value="broadcastclass.lua"/>
<talkaction log="yes" access="3" words="/mkick" event="script" value="masskick.lua"/>
<talkaction access="3" words="/z" event="script" value="magiceffect.lua"/>
<!-- Gamemasters -->
<talkaction log="yes" words="/ghost;/invisible" access="3" event="function" value="ghost"/>
<talkaction log="yes" words="/squelch" access="3" event="script" value="gamemaster.lua"/>
<talkaction log="yes" words="/cliport" access="3" event="script" value="gamemaster.lua"/>
<talkaction log="yes" words="/t" access="2" event="script" value="teleportmaster.lua"/>
<talkaction log="yes" words="/c" access="3" event="script" value="teleporthere.lua"/>
<talkaction log="yes" words="/goto" access="2" event="script" value="teleportto.lua"/>
<talkaction log="yes" words="/a" access="3" event="script" value="teleporttiles.lua"/>
<talkaction log="yes" words="/kick" access="3" event="script" value="kick.lua"/>
<talkaction log="yes" words="/send" access="3" event="script" value="teleportsend.lua"/>
<talkaction log="yes" words="/unban" access="6" event="script" value="unban.lua"/>
<talkaction log="yes" words="/town" access="3" event="script" value="teleporttown.lua"/>
<talkaction log="yes" words="/up" access="3" event="script" value="teleportfloor.lua"/>
<talkaction log="yes" words="/down" access="3" event="script" value="teleportfloor.lua"/>
<talkaction log="yes" words="/save" access="3" event="script" value="save.lua"/>
<talkaction log="yes" words="/clean" access="3" event="script" value="clean.lua"/>
<talkaction log="yes" words="/reports" access="3" event="script" value="reports.lua"/>
<talkaction log="yes" words="/mc" access="3" event="script" value="multicheck.lua"/>
<talkaction log="yes" words="/wp" access="3" event="script" value="waypoints.lua"/>
<!-- Senior Tutors -->
<talkaction log="yes" words="/notations" access="2" event="script" value="notations.lua"/>
<talkaction log="yes" words="/gethouse" access="2" event="script" value="gethouse.lua"/>
<talkaction log="yes" words="/b" access="2" event="script" value="broadcast.lua"/>
<!-- Tutors -->
<talkaction log="yes" access="1" words="/baninfo" event="function" value="banishmentInfo"/>
<talkaction log="yes" access="1" words="/pos" event="script" value="position.lua"/>
<talkaction log="yes" access="1" hide="yes" words="!pos" event="script" value="position.lua"/>
<!-- Players -->
<talkaction words="!buypromotion" script="promotion.lua"/>
<talkaction words="!spells" script="spells.lua"/>
<talkaction words="!frags;/frags" event="script" value="frags.lua"/>
<talkaction words="!aol" script="aol.lua" />
<talkaction words="!online;/online" event="script" value="online.lua"/>
<talkaction words="!uptime;/uptime" event="script" value="uptime.lua"/>
<talkaction words="!deathlist;/deathlist" event="script" value="deathlist.lua"/>
<talkaction words="!pvp;/pvp" event="script" value="pvp.lua"/>
<talkaction words="!q" event="script" value="money.lua"/>
<talkaction words="!buybless;/buybless;!bless;/bless" script="bless.lua" />
<talkaction words="!addon" event="script" value="addondoll.lua"/>
<talkaction words="!rank;/rank" event="script" value="ranks.lua"/>
<talkaction words="!commands;/commands" event="script" value="commands.lua"/>
<talkaction words="/war" channel="0" event="script" value="war.lua" desc="(Guild channel command) War management."/>
<!-- Houses -->
<talkaction words="!buyhouse;/buyhouse" filter="word-spaced" event="function" value="houseBuy"/>
<talkaction words="!sellhouse;/sellhouse" filter="word-spaced" event="function" value="houseSell"/>
<talkaction words="alana sio" filter="word-spaced" event="function" value="houseKick"/>
<talkaction words="aleta grav" filter="word-spaced" event="function" value="houseDoorList"/>
<talkaction words="aleta sio" filter="word-spaced" event="function" value="houseGuestList"/>
<talkaction words="aleta som" filter="word-spaced" event="function" value="houseSubOwnerList"/>
<talkaction words="!leavehouse;/leavehouse;alana som" filter="word-spaced" event="script" value="leavehouse.lua"/>
<!-- Guilds -->
<talkaction words="!createguild;/createguild" event="function" value="guildCreate"/>
<talkaction words="!joinguild;/joinguild" event="function" value="guildJoin"/>
</talkactions>
Link para o comentário
Compartilhar em outros sites

vai na pasta data/talkactions/scripts/ranks.lua e substitua o script por esse ( faça uma copia do arquivo caso nao funcione hehe!

 

 

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 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, "este rank não existe.") return true
end
str = "--[ Recordes "..(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)
return true
end

 

Link para o comentário
Compartilhar em outros sites

vai na pasta data/talkactions/scripts/ranks.lua e substitua o script por esse ( faça uma copia do arquivo caso nao funcione hehe!

 

 

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 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, "este rank não existe.") return true

end

str = "--[ Recordes "..(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)

return true

end

 

ixi, não deu não..

olha o que deu..

 

[Error - LuaInterface::loadFile] data/talkactions/scripts/ranks.lua:1: '=' expected near 'config'
[Error - Event::checkScript] Cannot load script (data/talkactions/scripts/ranks.lua)
data/talkactions/scripts/ranks.lua:1: '=' expected near 'config'
[Error - LuaInterface::loadFile] data/talkactions/scripts/ranks.lua:1: '=' expected near 'config'
[Error - Event::checkScript] Cannot load script (data/talkactions/scripts/ranks.lua)
data/talkactions/scripts/ranks.lua:1: '=' expected near 'config'
(done).
Link para o comentário
Compartilhar em outros sites

utiliza o meu e vê se dá

 

local ranks =
{
['fist'] = {SKILL_FIST},
['club'] = {SKILL_CLUB},
['sword'] = {SKILL_SWORD},
['axe'] = {SKILL_AXE},
['distance'] = {SKILL_DISTANCE},
['shield'] = {SKILL_SHIELD},
['fish'] = {SKILL_FISHING},
['magic'] = {SKILL__MAGLEVEL},
['level'] = {SKILL__LEVEL}
}
function onSay(cid, words, param)
local msg = string.lower(param)
if ranks[msg] ~= nil then
str = getHighscoreString((ranks[msg][1]))
else
str = getHighscoreString((SKILL__LEVEL))
end
doPlayerPopupFYI(cid, str)
return TRUE
end
Link para o comentário
Compartilhar em outros sites

  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...