Ir para conteúdo

[Pedido] Talkaction Player Vai Para Cadeia Quando Fala Palavão


lipezinhoh

Posts Recomendados

Tipo do script: Talkactions

Protocolo (versão do Tibia): 9.10

Servidor utilizado: crystal serve

 

Bom, eu tenho o sistema de cadeia !jail, e tambem o sistema que transforma o player em "bug" quando fala palavrão.

O meu pedido é o sequinte:

 

Quando o player falar três vezes palavrão, que ele vá para cadeia.

No caso assim, ele fala palavrão uma vez, vira "bug"

Fala palavrão uma segunda vez, vira "bug" novamente e perde uma certa quantidade de life.

Na terceira vez que ele o fizer, ele é teleportado para a cadeia.

 

Segue abaixo os scripts que possuo.

 

Script da Cadeia

 

-- Default jail time in seconds --

default_jail = 120

-- The permission you need to jail someone --

grouprequired = 3

-- StorageValue that the player gets --

jailedstoragevalue_time = 1338

jailedstoragevalue_bool = 1339

-- POSIcaO DA CADEIA: --

jailpos = { x = 809, y = 2147, z =6 }

-- POSICAO DO TEMPLO: --

unjailpos = { x = 801, y =966, z =7 }

-- auto kicker, dont edit

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,'You were kicked from jail! See you later ')

end

else

table.remove(jail_list,targetID)

end

end

end

 

function onSay(cid, words, param)

if jail_list_work == 0 then

jail_list_work = addEvent(checkJailList, 1000, {})

end

if param == '' and (words == '!unjail' or words == '/unjail') then

if getPlayerStorageValue(cid, jailedstoragevalue_time) > os.time() then

doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You are jailed until ' .. os.date("%H:%M:%S", getPlayerStorageValue(cid, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')

else

if getPlayerStorageValue(cid, jailedstoragevalue_bool) == 1 then

table.insert(jail_list,cid)

doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You will be kicked from jail in one second.')

else

doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You are not jailed.')

end

end

return TRUE

end

local jail_time = -1

for word in string.gmatch(tostring(param), "(%w+)") do

if tostring(tonumber(word)) == word then

jail_time = tonumber(word)

end

end

local isplayer = getPlayerByName(param)

if isPlayer(isplayer) ~= TRUE then

isplayer = getPlayerByName(string.sub(param, string.len(jail_time)+1))

if isPlayer(isplayer) ~= TRUE then

isplayer = getPlayerByName(string.sub(param, string.len(jail_time)+2))

if isPlayer(isplayer) ~= TRUE then

isplayer = getPlayerByName(string.sub(param, string.len(jail_time)+3))

end

end

end

if jail_time ~= -1 then

jail_time = jail_time * 60

else

jail_time = default_jail

end

if words == '!jail' or words == '/jail' then

if getPlayerGroupId ( cid ) >= grouprequired then

if isPlayer(isplayer) == TRUE then

doTeleportThing(isplayer, jailpos, TRUE)

setPlayerStorageValue(isplayer, jailedstoragevalue_time, os.time()+jail_time)

setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 1)

table.insert(jail_list,isplayer)

doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You jailed '.. getCreatureName(isplayer) ..' until ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')

doPlayerSendTextMessage ( isplayer, MESSAGE_INFO_DESCR, 'You have been jailed by '.. getCreatureName(cid) ..' until ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')

return TRUE

else

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player with this name doesn\'t exist or is offline.")

return FALSE

end

else

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have access to unjail other players.")

return FALSE

end

elseif words == '!unjail' or words == '/unjail' then

if getPlayerGroupId ( cid ) >= grouprequired then

if isPlayer(isplayer) == TRUE 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,getCreatureName(cid) .. ' let you go out from jail! See you later')

doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You unjailed '.. getCreatureName(isplayer) ..'.')

else

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player with this name doesn\'t exist or is offline.")

return FALSE

end

else

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have access to unjail other players.")

return FALSE

end

end

return FALSE

end

 

<talkaction words="!jail" script="Cadeia.lua"/>

 

Script que proíbe palavrão

 

function onSay(cid, words, param)

local time = 10 -- Tempo que ele ficará com outra outfit e muted! (em segundos)

local life = 15 -- Quantidade de vida que o player perderá!

doSendAnimatedText(getPlayerPosition(cid), "Hey man, this is forbidden!", 19)

doPlayerSendTextMessage(cid, 23, "Now you are muted and other outfit for "..time.." seconds!")

doCreatureAddHealth(cid, -life)

doSetMonsterOutfit(cid, "Bug", time*1000)

doMutePlayer(cid, time*1000)

return TRUE

end

 

<talkaction words="porra;caralho;cu;merda;buceta" event="script" value="proibido.lua"/>

 

Desde já agradeço.

 

 

+button_ok.png

Editado por lipeehhhh
Link para o comentário
Compartilhar em outros sites

tenta troca o script de palavrões por isso(n testado)

 

 

time = 220 ---tempo na cadeia

 

jailedstoragevalue_time = 1338

jailedstoragevalue_bool = 1339

jailpos = { x = 809, y = 2147, z =6 }

 

 

 

function onSay(cid, words, param)

 

if getPlayerStorageValue(cid, 54312) <= 0 then

 

local time = 10 -- Tempo que ele ficará com outra outfit e muted! (em segundos)

local life = 15 -- Quantidade de vida que o player perderá!

doSendAnimatedText(getPlayerPosition(cid), "Hey man, this is forbidden!", 19)

doPlayerSendTextMessage(cid, 23, "Now you are muted and other outfit for "..time.." seconds!")

doSetMonsterOutfit(cid, "Bug", time*1000)

doMutePlayer(cid, time*1000)

setPlayerStorageValue(cid, 54312, 1)

 

elseif getPlayerStorageValue(cid, 54312) == 1 then

 

local life = 100 ------life que o player vai perder

doSendAnimatedText(getPlayerPosition(cid), "Hey man, this is forbidden!", 19)

doPlayerSendTextMessage(cid, 23, "Now you are muted and other outfit for "..time.." seconds!")

doCreatureAddHealth(cid, -life)

doSetMonsterOutfit(cid, "Bug", time*2000)

doMutePlayer(cid, time*10000)

setPlayerStorageValue(cid, 54312, 2)

 

elseif getPlayerStorageValue(cid, 54312) == 2 then

 

doTeleportThing(cid, jailpos, TRUE)

setPlayerStorageValue(cid, jailedstoragevalue_time, os.time()+time)

setPlayerStorageValue(cid, jailedstoragevalue_bool, 1)

table.insert(jail_list,cid)

doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You have been jailed, until ' .. os.date("%H:%M:%S", getPlayerStorageValue(cid, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')

setPlayerStorageValue(cid, 54312, 0)

end

return TRUE

end

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...