Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Olá galera, eu coloquei um sistema de jail no meu serv que eu peguei de um outro otserv

porem esse mesmo comando nao pega no meu serv e aparece o seguinte erro:

 

[25/04/2018 21:00:31] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/cadeia.lua:7: '}' expected (to close '{' at line 4) near '['
[25/04/2018 21:00:31] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/cadeia.lua)
[25/04/2018 21:00:32] data/talkactions/scripts/cadeia.lua:7: '}' expected (to close '{' at line 4) near '['

 

se alguem poder me ajudar a reparar esse error eu agradeço 

 script do comando:

  Citar

function onSay(cid,words,param)
local t = string.explode(param, ",")

local config = {
[1] = {x=1024, y=906, z=10},
[2] = {x=1028, y=906, z=10}
[3] = {x=1033, y=906, z=10},
[4] = {x=1033, y=898, z=10},
[5] = {x=1028, y=898, z=10}
[6] = {x=1023, y=898, z=10},
}

local from1,to1 = {x=1022, y=905, z=10},{x=1030, y=907, z=10}
local from2,to2 = {x=1022, y=907, z=10},{x=1030, y=915, z=10}
local temple = {x=1024, y=910, z=7} -- cordenadas do templo
local Player_Name = getPlayerByNameWildcard(t[1])

if not t[1] then
doPlayerSendTextMessage(cid, 27, "Digite o nome do jogador.")
return TRUE
end

if not Player_Name then
doPlayerSendTextMessage(cid, 27, "O jogador nao existe ou esta offline.")
return TRUE
end

local Player_Pos = getThingPos(Player_Name)

local function Unjail()
if isPlayer(cid) then
doTeleportThing(Player_Name, temple)
end
end

if not tonumber(t[2]) or tonumber(t[2]) < 1 or t[2] == "" then
doPlayerSendTextMessage(cid, 27, "Coloque a quantidade de tempo em minutos!")
return TRUE
end

if getPlayerAccess(Player_Name) >= 2 then
doPlayerSendTextMessage(cid, 27,"Voce nao pode prender um GM ou alguem superior a ele.")
return TRUE
end

if isInRange(Player_Pos, from1, to1) or isInRange(Player_Pos, from2, to2) then
doPlayerSendTextMessage(cid, 27,"O jogador ja esta preso!")
return TRUE
end

doTeleportThing(Player_Name, config[math.random(#config)])
doSendAnimatedText(Player_Pos, "JAIL!", TEXTCOLOR_RED)
doPlayerSendTextMessage(Player_Name, 25,"Voce foi preso por fazer algo contra as regras! e ficara preso por "..(tonumber(t[2])).." minuto"..(tonumber(t[2]) > 1 and "s" or "")..".")
doPlayerSendTextMessage(cid, 27,"Voce prendeu o jogador "..t[1].." por "..(tonumber(t[2])).." minuto"..(tonumber(t[2]) > 1 and "s" or "")..".")
addEvent(Unjail, t[2]*60*1000, Player_Name)
return TRUE
end

 

Valendo REP+

Resolvido por Ackerzin

Ir para solução
Postado
  • Solução
  Em 26/04/2018 em 00:03, Jociel disse:

Olá galera, eu coloquei um sistema de jail no meu serv que eu peguei de um outro otserv

porem esse mesmo comando nao pega no meu serv e aparece o seguinte erro:

 

[25/04/2018 21:00:31] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/cadeia.lua:7: '}' expected (to close '{' at line 4) near '['
[25/04/2018 21:00:31] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/cadeia.lua)
[25/04/2018 21:00:32] data/talkactions/scripts/cadeia.lua:7: '}' expected (to close '{' at line 4) near '['

 

se alguem poder me ajudar a reparar esse error eu agradeço 

 script do comando:

 

Valendo REP+

 

 

Ta faltando algumas virgulas.

 

 

function onSay(cid,words,param)
local t = string.explode(param, ",")

local config = {
[1] = {x=1024, y=906, z=10},
[2] = {x=1028, y=906, z=10},
[3] = {x=1033, y=906, z=10},
[4] = {x=1033, y=898, z=10},
[5] = {x=1028, y=898, z=10},
[6] = {x=1023, y=898, z=10},
}

local from1,to1 = {x=1022, y=905, z=10},{x=1030, y=907, z=10}
local from2,to2 = {x=1022, y=907, z=10},{x=1030, y=915, z=10}
local temple = {x=1024, y=910, z=7} -- cordenadas do templo
local Player_Name = getPlayerByNameWildcard(t[1])

if not t[1] then
doPlayerSendTextMessage(cid, 27, "Digite o nome do jogador.")
return TRUE
end

if not Player_Name then
doPlayerSendTextMessage(cid, 27, "O jogador nao existe ou esta offline.")
return TRUE
end

local Player_Pos = getThingPos(Player_Name)

local function Unjail()
if isPlayer(cid) then
doTeleportThing(Player_Name, temple)
end
end

if not tonumber(t[2]) or tonumber(t[2]) < 1 or t[2] == "" then
doPlayerSendTextMessage(cid, 27, "Coloque a quantidade de tempo em minutos!")
return TRUE
end

if getPlayerAccess(Player_Name) >= 2 then
doPlayerSendTextMessage(cid, 27,"Voce nao pode prender um GM ou alguem superior a ele.")
return TRUE
end

if isInRange(Player_Pos, from1, to1) or isInRange(Player_Pos, from2, to2) then
doPlayerSendTextMessage(cid, 27,"O jogador ja esta preso!")
return TRUE
end

doTeleportThing(Player_Name, config[math.random(#config)])
doSendAnimatedText(Player_Pos, "JAIL!", TEXTCOLOR_RED)
doPlayerSendTextMessage(Player_Name, 25,"Voce foi preso por fazer algo contra as regras! e ficara preso por "..(tonumber(t[2])).." minuto"..(tonumber(t[2]) > 1 and "s" or "")..".")
doPlayerSendTextMessage(cid, 27,"Voce prendeu o jogador "..t[1].." por "..(tonumber(t[2])).." minuto"..(tonumber(t[2]) > 1 and "s" or "")..".")
addEvent(Unjail, t[2]*60*1000, Player_Name)
return TRUE
end

 

Esse aqui embaixo é o que eu uso no meu servidor.

 

Mostrar conteúdo oculto

 

       112674.gif

 

 

 

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