Ir para conteúdo

Featured Replies

Postado

Boa tarde galera, estou procurando um sistema de prisão que funcione no TFS 1.2, já tentei vários que encontrei aqui e em outros fóruns, e sempre sem efeito. Não sei se é algo que está errado ou se é mesmo por ser antigo, mas imagino que seja por ser de outras versões.

 

O que eu preciso mesmo é que o comando funcione, enviando o player para X lugar e que tenha uma duração de 5 horas na prisão. Fiz um NPC que pagando 50kk de fiança, o player será teleportado para outro lugar.

 

 

Scripts que testei: 

 

https://otland.net/threads/jail-system-with-auto-kick-by-gesior.12356/

 

https://otland.net/threads/tfs-1-1-jail-unjail-system.229642/

 

Código que consegui que funcionasse mas gostaria de inserir um tempo de 5h horas caso o player não tenha 50kk para ser liberado.

local config = {
    -- List of players that cannot be jailed
    blacklist = {'GM', 'Admin'},
    -- if true you can even jail other GMs :)
    canJailAccess = false,
 
    -- if true it will not show the name of the Staff member that used the command
    anonymous = true,
 
    -- Position of your jail
    jailPosition = Position(32458, 32204, 7),
 
    -- if unjailToTemple is set to true it will teleport the player to their hometown
    -- otherwise it will use unjailPosition
    unjailToTemple = false,
    unjailPosition = Position(32576, 31594, 12)
 
 
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
 
    local targetPlayer = Player(param)
    if not targetPlayer then
        player:sendCancelMessage('Usage: ' .. words .. ' <playername>')
        return false
    end
 
    if not config.canJailAccess and targetPlayer:getGroup():getAccess() then
        player:sendCancelMessage('Voce nao pode prender este player.')
        return false
    end
 
    local toPosition
    if words == '/jail' then
        toPosition = config.jailPosition
    elseif words == '/unjail' then
        if config.unjailToTemple then
            toPosition = targetPlayer:getTown():getTemplePosition()
        else
            toPosition = config.unjailPosition
        end
    end
 
    local action = string.sub(words, 2, #words) .. 'ed'
    player:sendCancelMessage('You have ' .. action .. ' ' .. player:getName() .. '.')
    targetPlayer:sendCancelMessage('You have been ' .. action .. (config.anonymous and '' or ' by ' .. targetPlayer:getName()) .. '.')
    targetPlayer:teleportTo(toPosition)
    toPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return false
end

Editado por lukindex (veja o histórico de edições)

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.8k

Informação Importante

Confirmação de Termo