Ir para conteúdo
  • Cadastre-se

(Resolvido)Como passar de segundos para minutos


Ir para solução Resolvido por luangop,

Posts Recomendados

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

 

Link para o post
Compartilhar em outros sites

@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

Link para o post
Compartilhar em outros sites
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)
Link para o post
Compartilhar em outros sites

@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

Link para o post
Compartilhar em outros sites
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)
Link para o post
Compartilhar em outros sites
42 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

como faço pra bota em hora , exemplo 

!prendi fulano,60 < esse 60 seria 1hora no caso , so q esse ai do lek pra ser uma hora seria !prender fulano,3800 ai daria uma hr kk 

Link para o post
Compartilhar em outros sites

@marcossouza então no caso é 60 < segundos * 60 < minutos * 60 horas

 

segundos * 60

minutos *60 *60

horas *60*60*60

@iury alves potter tenta reiniciar o servidor e testar com um char diferente ...

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
17 minutos atrás, Brunds disse:

@marcossouza então no caso é 60 < segundos * 60 < minutos * 60 horas

 

segundos * 60

minutos *60 *60

horas *60*60*60

@iury alves potter tenta reiniciar o servidor e testar com um char diferente ...

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 *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

Coloquei ate pra marca em horas. mais ainda ta marcando segundos . eu preciso literalmente reniciar o servido não basta apenas dar /reload ?

 

 

Link para o post
Compartilhar em outros sites

@iury alves potter 

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, 60*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, 60*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

testa agora

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
4 minutos atrás, Brunds disse:

@iury alves potter 


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, 60*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, 60*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

testa agora

Ainda continua dando em segundos.

Link para o post
Compartilhar em outros sites

@iury alves potter só uma coisa apaga o ultimo end e escreve novamente ...

ta com um problema ao copiar ele copia um espaço junto reescreve o ultimo end

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
5 minutos atrás, Brunds disse:

@iury alves potter só uma coisa apaga o ultimo end e escreve novamente ...

ta com um problema ao copiar ele copia um espaço junto reescreve o ultimo end

Ainda em segundos :v

Link para o post
Compartilhar em outros sites
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, 60*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, 60*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 *1000
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

caso não for mude essa linha

jail_time = jail_time * 60

para essa

 

 

jail_time = jail_time * 60 * 60

@iury alves potter

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
7 minutos atrás, Brunds disse:

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, 60*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, 60*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 *1000
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

caso não for mude essa linha


jail_time = jail_time * 60

 para essa

 

 


jail_time = jail_time * 60 * 60

 @iury alves potter

ta segundos ainda auheuehuehe , !prender marcos,60 Ta marcando 1minuto

Link para o post
Compartilhar em outros sites
16 minutos atrás, Brunds disse:

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, 60*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, 60*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 *1000
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

caso não for mude essa linha


jail_time = jail_time * 60

para essa

 

 


jail_time = jail_time * 60 * 60

@iury alves potter

E ainda esta em segundos :v

 

Link para o post
Compartilhar em outros sites
Spoiler

local unit = "min" -- "sec", "min", "hour", "day"

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) 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 not isPlayer(isplayer) then
        isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+1))
        if not isPlayer(isplayer) then
            isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+2))
            if not isPlayer(isplayer) then
                isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+3))
            end
        end
    end
    local default_jail = unit == "sec" and 30 or 1
    if(t[2]) then
        default_jail = t[2]
    end
    if jail_time ~= -1 then
        jail_time = mathtime({jail_time, unit})
    else
        jail_time = mathtime({default_jail, unit})
    end

    if (words == '!prender' or words == '/prender') then
        if getPlayerGroupId(cid) >= grouprequired then
            if isPlayer(isplayer) 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) 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

function mathtime(table) -- by dwarfer
local unit = {"sec", "min", "hour", "day"}
for i, v in pairs(unit) do
if v == table[2] then
return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1)
end
end
return error("Bad declaration in mathtime function.")
end

 

 

Edite a unidade do tempo nessa linha como desejar:

local unit = "min" -- "sec", "min", "hour", "day"

 

Contato:

 

Link para o post
Compartilhar em outros sites

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:
 

Spoiler

local grouprequired = 3
local jailedstoragevalue_time = 1338
local 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)
	local t = string.explode(param, ",")
	if(param == '') or (t[2] == '') or (t[3] == '') or (t[2] and t[2] ~= ("sec" or "min" or "hour" or "day")) or (t[3] and not tonumber(t[3])) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Modo de usar:\n /prender Nick, (sec, min, hour, day), numero\nEx: /prender Fulano, hour, 2\nVai prender por 2 horas.")
		return true
	end
	if jail_list_work == 0 then
		jail_list_work = addEvent(checkJailList, 1000, {})
	end
	local jail_time = tonumber(t[3])
	if t[2] == "sec" then jail_time = jail_time end
	if t[2] == "min" then jail_time = jail_time*60 end
	if t[2] == "hour" then jail_time = (jail_time*60)*60 end
	if t[2] == "day" then jail_time = ((jail_time*60)*60)*24 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
	
	
	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

 

Vai usar da seguinte forma:

/prender Nick, (sec, min, hour ou day), numero

Por exemplo: /prender Fulano, hour, 3

Vai prender o player Fulano por 3 horas.

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

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