Ir para conteúdo
  • Cadastre-se

(Resolvido)Como colocar mute com script de prisão


Ir para solução Resolvido por KotZletY,

Posts Recomendados

Bom galera to precisando de adcionar mute junto com esse script aki pois no meu servido existe o comando /bug . ou seja eles pode fugir da prisão. Ou se alguem tem algum script q faz com que os player não podem usar comandos em determinado local. abaixo o script da prisão. Ajuda Rep++

Spoiler

grouprequired = 3
jailedstoragevalue_time = 1338
jailedstoragevalue_bool = 1339
local jailpos = {
[1] = {x = 59, y = 52, z =6},
[2] = {x = 59, y = 52, z =5},
[3] = {x = 55, y = 47, z =6},
[4] = {x = 55, y = 47, z =5},
[5] = {x = 55, y = 52, z =6},
[6] = {x = 55, y = 52, z =5},
[7] = {x = 59, y = 47, z =5},
[8] = {x = 63, y = 52, z =5}
}
local unjailpos = { x = 63, y = 54, z =6 }
jail_list = {}
jail_list_work = 0

function checkJailList(param)
addEvent(checkJailList, 1000, {})
for targetID,player in ipairs(jail_list) do
if isPlayer(player) == TRUE then
if getPlayerStorageValue(player, jailedstoragevalue_time) < os.time() then
doTeleportThing(player, unjailpos, TRUE)
setPlayerStorageValue(player, jailedstoragevalue_time, 0)
setPlayerStorageValue(player, jailedstoragevalue_bool, 0)
table.remove(jail_list,targetID)
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você saiu da cadeia, tente não fazer coisas malvadas da próxima vez para não ser preso novamente. Cuide-se amigo.')
end
else
table.remove(jail_list,targetID)
end
end
end

function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
if jail_list_work == 0 then
jail_list_work = addEvent(checkJailList, 1000, {})
end
local jail_time = -1
for word in string.gmatch(tostring(t[1]), "(%w+)") do
if tostring(tonumber(word)) == word then
jail_time = tonumber(word)
end
end
local isplayer = getPlayerByName(t[1])
if isPlayer(isplayer) ~= TRUE then
isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+1))
if isPlayer(isplayer) ~= TRUE then
isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+2))
if isPlayer(isplayer) ~= TRUE then
isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+3))
end
end
end
local default_jail = 30
if(t[2]) then
default_jail = t[2]
end
if jail_time ~= -1 then
jail_time = jail_time * 60
else
jail_time = default_jail
end

if (words == '!prender' or words == '/prender') then
if getPlayerGroupId(cid) >= grouprequired then
if isPlayer(isplayer) == TRUE then
doTeleportThing(isplayer, jailpos[math.random(#jailpos)], TRUE)
setPlayerStorageValue(isplayer, jailedstoragevalue_time, os.time()+jail_time)
setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 1)
table.insert(jail_list,isplayer)
doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você prendeu o player: '.. getCreatureName(isplayer) ..' ate ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (agora é: ' .. os.date("%H:%M:%S", os.time()) .. ').')
doPlayerSendTextMessage (isplayer, MESSAGE_STATUS_CONSOLE_ORANGE, 'Voce foi preso por '.. getCreatureName(cid) ..' ate ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (agora é: ' .. os.date("%H:%M:%S", os.time()) .. ').')
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não existe ou esta offline.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem permissão para prender players.")
end
elseif (words == '!desprender' or words == '/desprender') then
if getPlayerGroupId(cid) >= grouprequired then
if isPlayer(isplayer) == TRUE then
if getPlayerStorageValue(isplayer, jailedstoragevalue_bool) == 1 then
doTeleportThing(isplayer, unjailpos, TRUE)
setPlayerStorageValue(isplayer, jailedstoragevalue_time, 0)
setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 0)
table.remove(jail_list,targetID)
doPlayerSendTextMessage(isplayer, MESSAGE_STATUS_CONSOLE_ORANGE, 'O player '.. getCreatureName(cid) ..' te tirou da prisão. Te vejo em breve!!!')
doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você tirou da prisão o player: '.. getCreatureName(isplayer) ..'.')
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não está preso.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não existe ou esta offline.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem permissão para prender players.")
end
end
return true
end

 

Link para o post
Compartilhar em outros sites

@iury alves potter seria melhor então você editar o script de bug verificando a storage do player caso o player tiver a storage de prisão ele não pode usar o comando bug ...

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Link para o post
Compartilhar em outros sites

Pode me ajudar? intão nesse modo ? arrumar o /bug para verificar se o player esta com a storage, ou preciso criar outro topico

Link para o post
Compartilhar em outros sites

@iury alves potter bom não sou scripter mas para acelerar o processo para um scripter capacitado te ajudar mais rapido edite o tópico principal e coloque o script de bug também assim o scripter vai poder colocar a verificação da storage da prisão no script do bug..

 

@KotZletY @Vodkart poderiam ajudar nosso membro com isso?

Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas.

discord.gg/phJZeHa2k4

 

Projeto ATS (Naruto)

Informações Abaixo

Facebook

Youtube
Discord

 

Tutoriais / Conteúdos

Clique Aqui

Link para o post
Compartilhar em outros sites

Coloque

if (getPlayerStorageValue(cid, 1339) ~= 0) then
	return doPlayerSendTextMessage(cid,25, "You cannot use this command in jail.")
end

abaixo da linha
 

function onSay(cid, words, param, channel)

do seu script de /bug.
 

  • Explicação. caso tenha interesse: ele verifica o storage 1339 se é diferente de 0 (a storage booleana do seu script de prisão), ou seja, verifica se o usuário está preso... Se estiver, ele finaliza o script mandando uma mensagem ao player de que ele não pode usar na prisão.
Editado por VitorSubhi
Acrescentado explicação do script. (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
10 horas atrás, KotZletY disse:

@iury alves potter poste o script responsável pelo comando /bug.

local tempo = 30
local storage = 98989898


function onSay(cid, words, param, condition, channel)

if getTileHouseInfo(getThingPos(cid)) then
  return doPlayerSendCancel(cid, "Desculpe, você está dentro da house.")
  end

if getPlayerStorageValue(cid, 63215) >= 1 then
doPlayerSendCancel(cid, "Você está no SURF.")
return false
end

if getPlayerStorageValue(cid,35485) > 0 then
doPlayerSendTextMessage(cid, 25, "Voce nao pode ir para o CP de saffron pois esta na Outfit' Quest, digite /leaveoutfit para sair dela.")
return true
end

if not getCreatureCondition(cid, CONDITION_INFIGHT) then

if (getPlayerStorageValue(cid, storage) <= os.time()) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSave(cid) 
doSendMagicEffect(getCreaturePosition(cid), 21)
   setPlayerStorageValue(cid, storage, os.time()+tempo)
else
   doPlayerSendCancel(cid, "Você so pode usar o comando daqui a "..tempo.." segundos.")
end
else
   doPlayerSendCancel(cid, "Você está em batalha.")
end
   return true
end


 

15 horas atrás, VitorSubhi disse:

Coloque


if (getPlayerStorageValue(cid, 1339) ~= 0) then
	return doPlayerSendTextMessage(cid,25, "You cannot use this command in jail.")
end

abaixo da linha
 


function onSay(cid, words, param, channel)

do seu script de /bug.
 

  • Explicação. caso tenha interesse: ele verifica o storage 1339 se é diferente de 0 (a storage booleana do seu script de prisão), ou seja, verifica se o usuário está preso... Se estiver, ele finaliza o script mandando uma mensagem ao player de que ele não pode usar na prisão.

Ok vou testa vlw por responder

Editado por iury alves potter (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

@iury alves potter utilize spolier para colocar os códigos ao invés de deixa-lo solto no/a tópico/resposta:

Spoiler

function onSay(cid, words, param, condition, channel)

if getTileHouseInfo(getThingPos(cid)) then
  return doPlayerSendCancel(cid, "Desculpe, você está dentro da house.")
end

if getPlayerStorageValue(cid, 63215) >= 1 then
doPlayerSendCancel(cid, "Você está no SURF.")
return false
end

if getPlayerStorageValue(cid,35485) > 0 then
doPlayerSendTextMessage(cid, 25, "Voce nao pode ir para o CP de saffron pois esta na Outfit' Quest, digite /leaveoutfit para sair dela.")
return true
end

if getPlayerStorageValue(cid, jailedstoragevalue_time) > os.time() then
doPlayerSendTextMessage(cid, 25, "Você não pode usa este comando enquanto estiver preso!")
return true
end

if not getCreatureCondition(cid, CONDITION_INFIGHT) then

if (getPlayerStorageValue(cid, storage) <= os.time()) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSave(cid) 
doSendMagicEffect(getCreaturePosition(cid), 21)
   setPlayerStorageValue(cid, storage, os.time()+tempo)
else
   doPlayerSendCancel(cid, "Você so pode usar o comando daqui a "..tempo.." segundos.")
end
else
   doPlayerSendCancel(cid, "Você está em batalha.")
end
   return true
end

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
Em 03/08/2018 em 19:54, iury alves potter disse:

Bom galera to precisando de adcionar mute junto com esse script aki pois no meu servido existe o comando /bug . ou seja eles pode fugir da prisão. Ou se alguem tem algum script q faz com que os player não podem usar comandos em determinado local. abaixo o script da prisão. Ajuda Rep++

  Ocultar conteúdo

grouprequired = 3
jailedstoragevalue_time = 1338
jailedstoragevalue_bool = 1339
local jailpos = {
[1] = {x = 59, y = 52, z =6},
[2] = {x = 59, y = 52, z =5},
[3] = {x = 55, y = 47, z =6},
[4] = {x = 55, y = 47, z =5},
[5] = {x = 55, y = 52, z =6},
[6] = {x = 55, y = 52, z =5},
[7] = {x = 59, y = 47, z =5},
[8] = {x = 63, y = 52, z =5}
}
local unjailpos = { x = 63, y = 54, z =6 }
jail_list = {}
jail_list_work = 0

function checkJailList(param)
addEvent(checkJailList, 1000, {})
for targetID,player in ipairs(jail_list) do
if isPlayer(player) == TRUE then
if getPlayerStorageValue(player, jailedstoragevalue_time) < os.time() then
doTeleportThing(player, unjailpos, TRUE)
setPlayerStorageValue(player, jailedstoragevalue_time, 0)
setPlayerStorageValue(player, jailedstoragevalue_bool, 0)
table.remove(jail_list,targetID)
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você saiu da cadeia, tente não fazer coisas malvadas da próxima vez para não ser preso novamente. Cuide-se amigo.')
end
else
table.remove(jail_list,targetID)
end
end
end

function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
local t = string.explode(param, ",")
if jail_list_work == 0 then
jail_list_work = addEvent(checkJailList, 1000, {})
end
local jail_time = -1
for word in string.gmatch(tostring(t[1]), "(%w+)") do
if tostring(tonumber(word)) == word then
jail_time = tonumber(word)
end
end
local isplayer = getPlayerByName(t[1])
if isPlayer(isplayer) ~= TRUE then
isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+1))
if isPlayer(isplayer) ~= TRUE then
isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+2))
if isPlayer(isplayer) ~= TRUE then
isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+3))
end
end
end
local default_jail = 30
if(t[2]) then
default_jail = t[2]
end
if jail_time ~= -1 then
jail_time = jail_time * 60
else
jail_time = default_jail
end

if (words == '!prender' or words == '/prender') then
if getPlayerGroupId(cid) >= grouprequired then
if isPlayer(isplayer) == TRUE then
doTeleportThing(isplayer, jailpos[math.random(#jailpos)], TRUE)
setPlayerStorageValue(isplayer, jailedstoragevalue_time, os.time()+jail_time)
setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 1)
table.insert(jail_list,isplayer)
doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você prendeu o player: '.. getCreatureName(isplayer) ..' ate ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (agora é: ' .. os.date("%H:%M:%S", os.time()) .. ').')
doPlayerSendTextMessage (isplayer, MESSAGE_STATUS_CONSOLE_ORANGE, 'Voce foi preso por '.. getCreatureName(cid) ..' ate ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (agora é: ' .. os.date("%H:%M:%S", os.time()) .. ').')
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não existe ou esta offline.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem permissão para prender players.")
end
elseif (words == '!desprender' or words == '/desprender') then
if getPlayerGroupId(cid) >= grouprequired then
if isPlayer(isplayer) == TRUE then
if getPlayerStorageValue(isplayer, jailedstoragevalue_bool) == 1 then
doTeleportThing(isplayer, unjailpos, TRUE)
setPlayerStorageValue(isplayer, jailedstoragevalue_time, 0)
setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 0)
table.remove(jail_list,targetID)
doPlayerSendTextMessage(isplayer, MESSAGE_STATUS_CONSOLE_ORANGE, 'O player '.. getCreatureName(cid) ..' te tirou da prisão. Te vejo em breve!!!')
doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você tirou da prisão o player: '.. getCreatureName(isplayer) ..'.')
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não está preso.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não existe ou esta offline.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem permissão para prender players.")
end
end
return true
end

 

o meu ta igual o seu ta em segundos , alguem conseguiria colocar pra ser em minutos? 

exemplo /prendi fulano,60

esse 60 ai seria no caso 1h , mais nesse ai ta em segundos ai nao acaba ficando 1h fica menos rs , se é q alguem entendeu

Link para o post
Compartilhar em outros sites
17 minutos atrás, marcossouza disse:

o meu ta igual o seu ta em segundos , alguem conseguiria colocar pra ser em minutos? 

exemplo /prendi fulano,60

esse 60 ai seria no caso 1h , mais nesse ai ta em segundos ai nao acaba ficando 1h fica menos rs , se é q alguem entendeu

https://tibiaking.com/forums/topic/91096-como-passar-de-segundos-para-minutos/?tab=comments#comment-498529

Link para o post
Compartilhar em outros sites

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