Ir para conteúdo
  • Cadastre-se

Posts Recomendados

  • 1 month later...

Desculpem se por acaso estou revivendo o tópico, mas não estou me aguentando de curiosidade... como faço para mandar o player para a prisão e automaticamente ele ficar "muted" pelo tempo em que ficar preso?!

Te Ajudei? Rep+  (y)

Link para o post
Compartilhar em outros sites
  • 1 year later...

Pow cara, meu ot é 10.10, ja configurei as celas, mas quando dou o comando não acontece nada... Alguem pode ajudar?? Nem aparece nenhum erro...

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites
  • 1 month later...

Versão testada: 9.4+ (Pode funcionar em anteriores)

Descrição: O script de cadeia feito por FreaksOt onde eu modifiquei e fiz algumas alterações.

Alterações:

- Quando prende o player ele não fica mais em um local fixo, você pode configurar para coloca-lo em outras celas.

- O tempo pode ou não ser fixo, é só você digitar /jail (nome do player) para um tempo fixo ou /jail (nome do player), (tempo) para coloca-lo com um tempo especifico.

-- OBS: O tempo é posto em segundos. (120 segundos = 2 minutos)

TAG:

<talkaction log="yes" words="/jail;!jail;/prender;!prender;/unjail;!unjail;/desprender;!desprender" access="3" event="script" value="prisao.lua"/>
Script:

data/talkaction/prisao.lua

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
Config:

local jailpos = { -- Local das selas onde o player vai aparecer.
local unjailpos = { x = 63, y = 54, z =6 } -- Local onde ele irá sair.
local default_jail = 30 -- Tempo padrão.
Créditos:

FreaksOt

Comedinha (Bruno Carvalho)

 

 

Configurei aqui, mas infelizmente não tá funcionando. E não dá erro na distro.

Link para o post
Compartilhar em outros sites
  • 6 months later...
  • 5 months later...
  • 2 weeks later...

tem como modificar pra quando matar 30 players e ir pra cadeia automaticamente ???


UP

Editado por alisonrenna (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 3 weeks later...

Desculpe se estou revivendo o topico mais é importante, a script funcionou no meu servidor 8.60 tfs 0.4 mais se o player for preso e deslogar e logar de novo ele não é solto automaticamente, tem como arrumar isso???

════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═══╗

Te Ajudei? Rep + e ficamos Quits

166420979_logoyanliimaornight.png.33f822b8970081a5b3646e85dbfd5934.png

Precisando de ajuda?

discord.png.1ecd188791d0141f74d99db371a2e0a4.png.890d5a38d7bcde75543c72b624a65de1.pngDiscord: Yan Liima #3702

Programador Júnior de LUA, PHP e JavaScript

Juntos somos lendas, separados somos Mitos!

╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝

Link para o post
Compartilhar em outros sites
  • 2 months later...

Desculpe se estou revivendo o topico mais é importante, a script funcionou no meu servidor 8.60 tfs 0.4 mais se o player for preso e deslogar e logar de novo ele não é solto automaticamente, tem como arrumar isso???

Desculpa reviver o tópico, é só você colocar área no-logout nos pisos específicos.

Link para o post
Compartilhar em outros sites
  • 1 year later...
  • 9 months later...
  • 3 months later...
Em 04/12/2012 em 13:08, Bruno Carvalho disse:

Versão testada: 9.4+ (Pode funcionar em anteriores)

Descrição: O script de cadeia feito por FreaksOt onde eu modifiquei e fiz algumas alterações.

 

Alterações:

- Quando prende o player ele não fica mais em um local fixo, você pode configurar para coloca-lo em outras celas.

- O tempo pode ou não ser fixo, é só você digitar /jail (nome do player) para um tempo fixo ou /jail (nome do player), (tempo) para coloca-lo com um tempo especifico.

-- OBS: O tempo é posto em segundos. (120 segundos = 2 minutos)

 

TAG:

 

 


<talkaction log="yes" words="/jail;!jail;/prender;!prender;/unjail;!unjail;/desprender;!desprender" access="3" event="script" value="prisao.lua"/>

[/code]




[i][b]Script:[/b][/i]

data/talkaction/prisao.lua

		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				
			Config:							 				local jailpos = { -- Local das selas onde o player vai aparecer.local unjailpos = { x = 63, y = 54, z =6 } -- Local onde ele irá sair.local default_jail = 30 -- Tempo padrão.

 

 

Créditos:

FreaksOt

Comedinha (Bruno Carvalho)

tem como eu por para o player perde exp? quando for presso é ficar 1 semana preso?

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