Postado Dezembro 15, 2014 10 anos Autor É porque está faltando o arquivo "cargo.lua" dentro da pasta "talkactions/scripts" Você tem certeza que criou ele, e colocou o código acima? o nome do Script estava diferente, mas deu esse erro: [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/cargos.lua:25: ')' expected (to close '(' at line 24) near 'addEvent' [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/cargos.lua) data/talkactions/scripts/cargos.lua:25: ')' expected (to close '(' at line 24) near 'addEvent' Meus Contatos! Minhas Funções: Skype: TsplayerT Facebook: TakaFukushii YouTube: ADoseDupla Twitter: @_Splayer_ Mapper:▓▓▓▓▓▓▓▓▓▓ 97% Programmer:▓▓▓▓▓▒▒▒▒▒ 45% Scripter:▓▓▓▓▓▓▓▓▓▒ 83% Spriter:▓▓▓▓▓▓▒▒▒▒ 57% Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99% Ot Creator:▓▓▓▓▓▓▓▒▒▒71% Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%
Postado Dezembro 15, 2014 10 anos Testa assim local cargos = { ["tutor"] = {prefixNick = "[TUTOR]", group = 2}, ["gm"] = {prefixNick = "[GM]", group = 4}, ["cm"] = {prefixNick = "[GM]", group = 5}, ["adm"] = {prefixNick = "[ADM]", group = 6} } local function kick(cid) if isPlayer(cid) then doRemoveCreature(cid, true) end return true end function onSay(cid, words, param, channel) local t = string.explode(param, ",") local c = cargos[t[2]:lower()] if param == "" or not tostring(t[1]) or not tostring(t[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o nome do jogador e o nome do cargo que deseja atribuir à ele, separados por vírgula. Exemplo: /cargo Player, GM") end if not isPlayer(getCreatureByName(t[1]:lower())) then return doPlayerSendCancel(cid, "Este player não está online, ou não existe.") end if not c then return doPlayerSendCancel(cid, "Cargo inexistente.") end db.executeQuery("UPDATE `players` SET `name` = '" .. c.prefixNick .. " ".. t[1]:lower() .. " ' WHERE name = '" .. t[1]:lower() .. "';") doPlayerSetGroupId(getCreatureByName(t[1]:lower(), c.group) addEvent(kick, 5 * 1000, getCreatureByName(t[1]:lower())) doPlayerSendTextMessage(getCreatureByName(t[1]:lower()), MESSAGE_STATUS_CONSOLE_BLUE, "Voce sera kikado em 5 segundos.") return true end Tony Araújo
Postado Dezembro 15, 2014 10 anos Autor Testa assim local cargos = { ["tutor"] = {prefixNick = "[TUTOR]", group = 2}, ["gm"] = {prefixNick = "[GM]", group = 4}, ["cm"] = {prefixNick = "[GM]", group = 5}, ["adm"] = {prefixNick = "[ADM]", group = 6} } local function kick(cid) if isPlayer(cid) then doRemoveCreature(cid, true) end return true end function onSay(cid, words, param, channel) local t = string.explode(param, ",") local c = cargos[t[2]:lower()] if param == "" or not tostring(t[1]) or not tostring(t[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o nome do jogador e o nome do cargo que deseja atribuir à ele, separados por vírgula. Exemplo: /cargo Player, GM") end if not isPlayer(getCreatureByName(t[1]:lower())) then return doPlayerSendCancel(cid, "Este player não está online, ou não existe.") end if not c then return doPlayerSendCancel(cid, "Cargo inexistente.") end db.executeQuery("UPDATE `players` SET `name` = '" .. c.prefixNick .. " ".. t[1]:lower() .. " ' WHERE name = '" .. t[1]:lower() .. "';") doPlayerSetGroupId(getCreatureByName(t[1]:lower(), c.group) addEvent(kick, 5 * 1000, getCreatureByName(t[1]:lower())) doPlayerSendTextMessage(getCreatureByName(t[1]:lower()), MESSAGE_STATUS_CONSOLE_BLUE, "Voce sera kikado em 5 segundos.") return true end Deu esse erro: [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/cargos.lua:32: ')' expected (to close '(' at line 31) near 'addEvent' Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/cargos.lua) data/talkactions/scripts/cargos.lua:32: ')' expected (to close '(' at line 31) near 'addEvent' @up Meus Contatos! Minhas Funções: Skype: TsplayerT Facebook: TakaFukushii YouTube: ADoseDupla Twitter: @_Splayer_ Mapper:▓▓▓▓▓▓▓▓▓▓ 97% Programmer:▓▓▓▓▓▒▒▒▒▒ 45% Scripter:▓▓▓▓▓▓▓▓▓▒ 83% Spriter:▓▓▓▓▓▓▒▒▒▒ 57% Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99% Ot Creator:▓▓▓▓▓▓▓▒▒▒71% Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%
Postado Dezembro 15, 2014 10 anos Aah claro, erro meu :s local cargos = { ["tutor"] = {prefixNick = "[TUTOR]", group = 2}, ["gm"] = {prefixNick = "[GM]", group = 4}, ["cm"] = {prefixNick = "[GM]", group = 5}, ["adm"] = {prefixNick = "[ADM]", group = 6} } local function kick(cid) if isPlayer(cid) then doRemoveCreature(cid, true) end return true end function onSay(cid, words, param, channel) local t = string.explode(param, ",") local c = cargos[t[2]:lower()] if param == "" or not tostring(t[1]) or not tostring(t[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o nome do jogador e o nome do cargo que deseja atribuir à ele, separados por vírgula. Exemplo: /cargo Player, GM") end if not isPlayer(getCreatureByName(t[1]:lower())) then return doPlayerSendCancel(cid, "Este player não está online, ou não existe.") end if not c then return doPlayerSendCancel(cid, "Cargo inexistente.") end db.executeQuery("UPDATE `players` SET `name` = '" .. c.prefixNick .. " ".. t[1]:lower() .. " ' WHERE name = '" .. t[1]:lower() .. "';") doPlayerSetGroupId(getCreatureByName(t[1]:lower(), c.group)) addEvent(kick, 5 * 1000, getCreatureByName(t[1]:lower())) doPlayerSendTextMessage(getCreatureByName(t[1]:lower()), MESSAGE_STATUS_CONSOLE_BLUE, "Voce sera kikado em 5 segundos.") return true end Tony Araújo
Postado Dezembro 15, 2014 10 anos Autor Aah claro, erro meu :s local cargos = { ["tutor"] = {prefixNick = "[TUTOR]", group = 2}, ["gm"] = {prefixNick = "[GM]", group = 4}, ["cm"] = {prefixNick = "[GM]", group = 5}, ["adm"] = {prefixNick = "[ADM]", group = 6} } local function kick(cid) if isPlayer(cid) then doRemoveCreature(cid, true) end return true end function onSay(cid, words, param, channel) local t = string.explode(param, ",") local c = cargos[t[2]:lower()] if param == "" or not tostring(t[1]) or not tostring(t[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite o nome do jogador e o nome do cargo que deseja atribuir à ele, separados por vírgula. Exemplo: /cargo Player, GM") end if not isPlayer(getCreatureByName(t[1]:lower())) then return doPlayerSendCancel(cid, "Este player não está online, ou não existe.") end if not c then return doPlayerSendCancel(cid, "Cargo inexistente.") end db.executeQuery("UPDATE `players` SET `name` = '" .. c.prefixNick .. " ".. t[1]:lower() .. " ' WHERE name = '" .. t[1]:lower() .. "';") doPlayerSetGroupId(getCreatureByName(t[1]:lower(), c.group)) addEvent(kick, 5 * 1000, getCreatureByName(t[1]:lower())) doPlayerSendTextMessage(getCreatureByName(t[1]:lower()), MESSAGE_STATUS_CONSOLE_BLUE, "Voce sera kikado em 5 segundos.") return true end Olha o erro: [Error - TalkAction Interface] [15/12/2014 17:25:15] data/talkactions/scripts/cargos.lua:onSay [15/12/2014 17:25:15] Description: [15/12/2014 17:25:15] data/talkactions/scripts/cargos.lua:17: attempt to index field '?' (a nil value) [15/12/2014 17:25:15] stack traceback: [15/12/2014 17:25:15] data/talkactions/scripts/cargos.lua:17: in function <data/talkactions/scripts/cargos.lua:15> Meus Contatos! Minhas Funções: Skype: TsplayerT Facebook: TakaFukushii YouTube: ADoseDupla Twitter: @_Splayer_ Mapper:▓▓▓▓▓▓▓▓▓▓ 97% Programmer:▓▓▓▓▓▒▒▒▒▒ 45% Scripter:▓▓▓▓▓▓▓▓▓▒ 83% Spriter:▓▓▓▓▓▓▒▒▒▒ 57% Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99% Ot Creator:▓▓▓▓▓▓▓▒▒▒71% Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%
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.