Ir para conteúdo

Featured Replies

Postado

Bom galera to com esse script de prisão mais ele ta contando em segundos exemplo

 !prender player ,5

Ele vai prender o player por 5 segundos . mais quero passar pra minutos  tem como ? 

logo abaixo o comando vlw ai todos q me ajudar ai ?

Rep++

Spoiler

grouprequired = 3
jailedstoragevalue_time = 1338
jailedstoragevalue_bool = 9222222
local jailpos = {
[1] = {x = 1294, y = 1207, z =5}, 
[2] = {x = 1294, y = 1216, z =5}, 
[3] = {x = 1298, y = 1216, z =5},
[4] = {x = 1302, y = 1216, z =5},
[5] = {x = 1306, y = 1207, z =5},
[6] = {x = 1310, y = 1207, z =5},
[7] = {x = 1306, y = 1216, z =5}, 
[8] = {x = 1310, y = 1216, z =5},
}
local unjailpos = { x = 1050, y = 1052, z =7 }
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

 

Resolvido por luangop

Ir para solução
  • Respostas 26
  • Visualizações 1.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Não chego nem perto do nível do @Dwarfer pra bolar uma função como aquela mathtime(table)... Mas apenas teste minha versão e me diga se funciona, to só praticando:   Vai usar da seguinte

  • @iury alves potter tente modificar o script nessa linha   jail_time = jail_time * 60   mude para    jail_time = jail_time * 60 * 60

  • @iury alves potter nada mano   @iury alves potter obs: spriting é de sprites desenhos o certo é scripting  corrigido já

Postado

@iury alves potter tente modificar o script nessa linha

 

jail_time = jail_time * 60

 

mude para 

 

jail_time = jail_time * 60 * 60

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

Postado
  • Autor
41 minutos atrás, Brunds disse:

@iury alves potter tente modificar o script nessa linha

 

jail_time = jail_time * 60

 

mude para 

 

jail_time = jail_time * 60 * 60

Mano testei aki e n mudou :v

 

 

 

Spoiler

grouprequired = 3
jailedstoragevalue_time = 1338
jailedstoragevalue_bool = 9222222
local jailpos = {
[1] = {x = 1294, y = 1207, z =5}, 
[2] = {x = 1294, y = 1216, z =5}, 
[3] = {x = 1298, y = 1216, z =5},
[4] = {x = 1302, y = 1216, z =5},
[5] = {x = 1306, y = 1207, z =5},
[6] = {x = 1310, y = 1207, z =5},
[7] = {x = 1306, y = 1216, z =5}, 
[8] = {x = 1310, y = 1216, z =5},
}
local unjailpos = { x = 1050, y = 1052, z =7 }
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 * 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

 

Editado por iury alves potter (veja o histórico de edições)

Postado

@iury alves potter nada mano ^^ 

@iury alves potter obs: spriting é de sprites desenhos o certo é scripting ^^ corrigido já

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

Postado
  • Autor
8 minutos atrás, Brunds disse:

@iury alves potter nada mano ^^ 

@iury alves potter obs: spriting é de sprites desenhos o certo é scripting ^^ corrigido já

Tipo na primeira vez q usei deu certo dps n deu mais '-'

Spoiler

grouprequired = 3
jailedstoragevalue_time = 1338
jailedstoragevalue_bool = 9222222
local jailpos = {
[1] = {x = 1294, y = 1207, z =5}, 
[2] = {x = 1294, y = 1216, z =5}, 
[3] = {x = 1298, y = 1216, z =5},
[4] = {x = 1302, y = 1216, z =5},
[5] = {x = 1306, y = 1207, z =5},
[6] = {x = 1310, y = 1207, z =5},
[7] = {x = 1306, y = 1216, z =5}, 
[8] = {x = 1310, y = 1216, z =5},
}
local unjailpos = { x = 1050, y = 1052, z =7 }
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 * 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

22:09 Voce foi preso por [ADM] Fire ate 22:11:09 (agora é: 22:10:09).
22:09 O player [ADM] Fire te tirou da prisão. Te vejo em breve!!!

Editado por iury alves potter (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.6k

Informação Importante

Confirmação de Termo