Aew,
Criei meu sistema de prisão, ja que eu não vi nenhum parecido em lugar nenhum.
Meu sistema tem umas coisas inovadoras:
1 - A rune que teleporta o prisioneiro para a prisão tem escolha de 3 penas facilmente configuraveis no script.
2 - Passado o tempo de prisão que o player recebeu de pena, ele poderá sair dando use na porta da prisão, caso não tenha passado o tempo, quando ele der use na door, irá aparecer quanto tempo falta para ele sair.
Assim sua prisão ficará facil de gerenciar!
Como escolher um dos 3 tempos de pena com a rune?
Isso é muito facil, é só o "policia" dar use na rune e em cima de si próprio e vai mudar, ai é só ele repetir isso até chegar na pena desejada.
agora o script:
1º na pasta data/actions/scripts crie um documento cujo nome cadeia.lua e dentro dele cole o seguinte:
--------Prison System by Colex----------- function onUse(cid, item, frompos, item2, topos) preso = os.time() - getPlayerStorageValue(cid,1444) judge = getPlayerStorageValue(cid,1445) tqf = judge - preso if getPlayerStorageValue(cid,1444) == -1 then doPlayerSendTextMessage(cid,22,"You are not arrested.") else if preso >= judge then doPlayerSendTextMessage(cid,22,"You are not a prisioner anymore. Go to your home!") doTeleportThing(cid,getPlayerMasterPos(cid)) setPlayerStorageValue(cid,1444,-1) else doPlayerSendTextMessage(cid,22,"Wait "..tqf.." seconds to get out from here.") end end return 1 end
2º Agora na mesma pasta crie um documento com o nome cadeia_rune.lua e adicione o seguinte dentro dele:
---------Prison System by Colex---------- function onUse(cid, item, frompos, item2, topos) cadeia = {x=485, y=473, z=7} ---coordenadas da cadeia now = os.time() -----tempos de prisão em segundos------- time1 = 10 time2 = 30 time3 = 60 --------------------------------------- time = getPlayerStorageValue(cid,1533) choose = getPlayerStorageValue(cid,1532) access = 3 ---acesso para usar a rune access2 = 3 --- a partir deste acesso nao é preso if getPlayerAccess(cid) >= access then if item2.itemid == cid then if getPlayerName(item2.uid) == getPlayerName(cid) then if choose == -1 then doPlayerSendTextMessage(cid,22,""..time1.." seconds of prison system.") setPlayerStorageValue(cid,1532,0) setPlayerStorageValue(cid,1533,time1) elseif choose == 0 then doPlayerSendTextMessage(cid,22,""..time2.." seconds of prison system.") setPlayerStorageValue(cid,1532,1) setPlayerStorageValue(cid,1533,time2) elseif choose == 1 then doPlayerSendTextMessage(cid,22,""..time3.." seconds of prison system.") setPlayerStorageValue(cid,1532,-1) setPlayerStorageValue(cid,1533,time3) end else if getPlayerAccess(item2.uid) < access2 then if getPlayerStorageValue(item2.uid,1444) == -1 then doPlayerSendTextMessage(item2.uid,22,"You are arrested for "..time.." seconds! Any word that you say now can be used against you later.") doTeleportThing(item2.uid,cadeia) setPlayerStorageValue(item2.uid,1445,time) setPlayerStorageValue(item2.uid,1444,now) else doPlayerSendTextMessage(cid,22,""..getPlayerName(item2.uid).." is already arrested.") end else doPlayerSendCancel(cid,"You cannot make this player a prisioner.") end end else doPlayerSendCancel(cid,"You can only use this rune on a person.") end else doPlayerSendCancel(cid,"You do not have the needed access to use this rune.") end return 1 end
3º Agora para terminar, na pasta data/actions abra o documento actions.xml e adicione as seguintes tags:
-------prison system------ <action actionid="1169" script="cadeia.lua" /> <action itemid="2312" script="cadeia_rune.lua" allowfaruse="1" blockwalls="0" /> --------------------------
NOTA 1 - a porta da prisão usa actionid 1169
NOTA 2 - a rune usada ali é 2312, caso queira usar outra é só trocar ali no actions.xml
Espero que gostem e aproveitem bem
cya~~ :hi: