Nie tylko o Tibii i OTS...
No więc chciałbym przedstawić "system więzienniczy"
Po co dawać komuś bana lepiej niech odsiedzi swoje w kiciu ;-)
Na początek [size=medium]BUDYNEK WIĘZIENIA[/size]
Ma to byc sala z przyłonczonymi 7 celami (bez przejscia do sali z celi).
Np:
Oczywiscie to wienzienie to tylko przykład można je dowolnie zmieniać (ale trzeba pamientac 1 sala i 7 cel)
No to tyle murowania czas przejsc dalej. :biggrin:
[size=medium]RUNKA PRZENOSZONCA PRZESTĘPCE DO JEDNEJ Z CEL[/size]
Najpierw tworzymy w data/action/scripts plik o nazwie celarune.lua a w jego tresci piszemy:
function onUse(cid, item, frompos, item2, topos)
if getPlayerAccess(cid) >=2 then
creature2pos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
creature2 = getThingfromPos(creature2pos)
doPlayerSendTextMessage(cid,22,"Acces sprawdzony")
ileposiedziminut = item.type
if ileposiedziminut == 0 then
ileposiedziminut = 1
end
doPlayerSendTextMessage(cid,22,"Blokada O")
odktorej = os.date('%M')
doktorej = odktorej + ileposiedziminut
if doktorej >= 60 then
dogodziny = os.date('%H') + 1
dominuty = 60 - doktorej
else
dogodziny = os.date('%H')
dominuty = doktorej
end
doPlayerSendTextMessage(cid,22,"Ustalono godzine")
xxx = os.date('%d')
doPlayerSendTextMessage(cid,22,"Ustalono dzien")
if creature2.itemid > 0 then
cela1={x=161, y=220, z=8}
cela2={x=152, y=225, z=8}
cela3={x=154, y=237, z=8}
cela4={x=161, y=242, z=8}
cela5={x=170, y=236, z=8}
cela6={x=170, y=230, z=8}
cela7={x=169, y=223, z=8} doPlayerSendTextMessage(cid,22,"Wykryto obecnosc gracza")
rand = math.random(1,7)
if rand == 1 then
doTeleportThing(creature2.uid,cela1)
elseif rand == 2 then
doTeleportThing(creature2.uid,cela2)
elseif rand == 3 then
doTeleportThing(creature2.uid,cela3)
elseif rand == 4 then
doTeleportThing(creature2.uid,cela4)
elseif rand == 5 then
doTeleportThing(creature2.uid,cela5)
elseif rand == 6 then
doTeleportThing(creature2.uid,cela6)
elseif rand == 7 then
doTeleportThing(creature2.uid,cela7)
end
doPlayerSendTextMessage(cid,22,"Teleportowano")
setPlayerStorageValue(creature2.uid,328,dominuty)
setPlayerStorageValue(creature2.uid,326,dogodziny)
setPlayerStorageValue(creature2.uid,327,xxx)
doPlayerSendTextMessage(cid,22,"Kara zapisana")
doPlayerSendTextMessage(cid,22,"Poszedl siedziec na kilka minut.")
doPlayerSendTextMessage(creature2.uid,18,"Kara wynosi do 100 minut w wiezieniu, nie wiesz na ile cie GM posadzil.")
else
doPlayerSendCancel(cid,"Pudlo.")
end
else
doPlayerSendCancel(cid,"IDZ Z TYM PRZEDMIOTEM DO GM MACIEJA A DOSTANIESZ WYSOKA NAGRODE")
end
return 1
end
tutaj wpisujemy zgodnie z tym co narysowaliśmy na swojej mapie.
(karzda z cel ma jedną kratke na ktorą ma byc teleportowany player, tylko cele nie sala główna)
cela1={x=161, y=220, z=8}
cela2={x=152, y=225, z=8}
cela3={x=154, y=237, z=8}
cela4={x=161, y=242, z=8}
cela5={x=170, y=236, z=8}
cela6={x=170, y=230, z=8}
cela7={x=169, y=223, z=8}
Nastempnie dodajesz w pliku data/actions/actions.xml linijke:
<action itemid="XXXX" script="celarune.lua" />
zastępując znaki XXXX dowolnym numerem RUNY !!!!!<czyli np 2312
Ilość minut spędzonych w więzieniu jest równa ILOŚCI POCISKÓW runy. Pociski nie ubywają podczas zużywania !!!!
To wszystko zwionzane z runką
[size=medium]TERAZ NPC STRAŻNIK[/size]
w data/npc tworzysz plik o nazwie Straznik.xml a w nim piszesz to:
<?xml version="1.0"?>
<npc name="Straznik" script="data/npc/scripts/Straznik.lua" access="3">
<look type="128" head="22" body="98" legs="132" feet="115"/>
</npc>
A w data/npc/scrips trzorzysz plik o nazwie Straznik.lua o tresci:
focus = 0
talk_start = 0
target = 0
cname = ''
following = false
attacking = false
gopos = 0
czas = 0
godzina1 = 0
dzisiaja = 0
dzisiaj = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
cname = creatureGetName(cid)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then
czydzisiaj = getPlayerStorageValue(cid,327)
dzisiaj = os.date('%d')
setPlayerStorageValue(cid,331,dzisiaj)
dzisiaja = getPlayerStorageValue(cid,331)
if czydzisiaj == dzisiaja then
godzina = os.date('%H')
minuta = os.date('%M')
doktorejh = getPlayerStorageValue(cid,326)
doktorejm = getPlayerStorageValue(cid,328)
setPlayerStorageValue(cid,333,godzina)
ileh = godzina - doktorejh
if ileh < 2 then
godzina1 = getPlayerStorageValue(cid,333)
if doktorejh == godzina1 then
setPlayerStorageValue(cid,332,minuta)
minuta1 = getPlayerStorageValue(cid,332)
if doktorejm > minuta1 then
selfSay('Cicho tam !! Jeszcze nie wychodzisz !!! Siedzisz jeszcze pare minut')
else
selfSay('Nastepnym razem zachowuj sie poprawnie.')
selfSay('/send ' .. cname .. ', 160 54 7')
end
else
selfSay('Cicho tam !!! Jeszcze sobie posiedzisz troszke !!!!')
end
else
selfSay('Nastepnym razem zachowuj sie poprawnie, posiedziales pare godzin i widzisz jaki jestes spokojny?')
selfSay('/send ' .. cname .. ', 160 54 7')
end
else
selfSay('Nastepnym razem zachowuj sie poprawnie to nie bedziesz siedzial calego dnia.')
selfSay('/send ' .. cname .. ', 160 54 7')
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Macie za swoje CHAMY !!!!!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('I nie mysl ze nie patrze !!!!')
focus = 0
end
end
if (os.clock() - gopos) > 1 then
ldx = 157
pdx = 166
pgx = 166
lgx = 157
ldy = 237
pdy = 237
lgy = 225
pgy =225
cx, cy, cz = selfGetPosition()
if cx == ldx and cy < ldy then
ny = cy + 1
nx = cx
elseif cx == pgx and cy > pgy then
ny = cy - 1
nx = cx
elseif cy == pdy and pdx < 166 then
nx = cx + 1
ny = cy
elseif cy == pgy and cx > lgx then
nx = cx - 1
ny = cy
end
gopos = os.clock()
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
end
UWAGA!!
linijki:
ldx = 157
pdx = 166
pgx = 166
lgx = 157
ldy = 237
pdy = 237
lgy = 225
pgy =225
nalerzy sobie ustawić wedlug:
pd = prawy dolny
pg = prawy górny
ld = lewy dolny
lg = lewy górny
To jest to po czym bendzie sie poruszal npc (muszą byc wieszcholki prostokąta lub kwadratu)(to sala glowna)
Uwaga!!!
-npc musi sie znajdowac na jednym z wieszcholkow lub na trasie inaczej nici z poruszania sie
-Aby zapobiec ucieczce dokonujemy w skrypcie teleportera nastempujoncych zmian
zaraz po linijce:
function onUse(cid, item, frompos, item2, topos)
dodajemy:
posp = getPlayerPosition(cid)
mozna = getTilePzInfo(posp)
if mozna == 0 then
a na koncu przed slowem "end":
else
doPlayerSendCancel(cid,"Nie w Protection zone !!!.")
end
CALĄ POWIESZCHNIE WIĘZIENIA POKRYWAMY PROTECTION ZONE
TO BY BYLO NA TYLE MYSLE ZE ZECHCECIE ZAMIESCIC WIENZIENIE NA SWOIM OTSIE :-P
Aha jesli chcecie dodac npc Straznika to data/worls/npc.xml i dodajecie linijke :
<npc name="Straznik" x="xx" y="xx" z="x"/>
zamiast xxx wasze współrzędne sali w więzieniu.
Offline
Zbanowany
Offline
Nie znam takiego otsa ale za niedlógo bedzie moj ots tak miał a wiesz jak skopiowac mape np svargron z wszystimi poziomami ?? i wkleic ja do mojej mapy?
Offline
Offline
Zbanowany
Offline
Offline
[Musisz być zalogowany, aby przeczytać ukrytą wiadomość]
Offline
Zbanowany
Offline
Sułtan łechtaczek
Ten skrypt jest cienki lepszy taki nietrzeba jakiś run
W data\talkactions\scripts stwórz plik jail.lua i wpisz w nim
napisał:
function onSay(cid,words,param)
local Server = 'tfs' ----- 'tfs' or 'other'
local StorageValue = 5500
local AccessToUse = 0
local GroupIdToUse = 0
local PosToGo = {x=90,y=125,z=7} --- Position to teleport the player after his jail time is up ( only for tfs, evolutions will send the player to his temple )
local Jail = {} --- dont change
------ you dont need to fill in all jail pos
------ just the ones you have on your map, leave the others blank
Jail[1] = {x=0,y=0,z=0}
Jail[2] = {x=0,y=0,z=0}
Jail[3] = {x=86,y=122,z=7}
Jail[4] = {x=0,y=0,z=0}
Jail[5] = {x=0,y=0,z=0}
Jail[6] = {x=0,y=0,z=0}
Jail[7] = {x=0,y=0,z=0}
Jail[8] = {x=0,y=0,z=0}
Jail[9] = {x=0,y=0,z=0}
Jail[10] ={x=0,y=0,z=0}
------ \/ dont change
Name = ""
Time = 0
Sep = nil
Sep_2 = nil
------/\ dont change
if param ~= "" then
Sep=string.find(param,"%,")
Sep_2=string.find(param,"%;")
if Sep ~= nil and Sep_2 ~= nil then
Name=string.sub(param,1,Sep-1)
Reason=string.sub(param,string.len(Name)+2,string.len(param)-2)
Time=string.sub(param,(string.len(Name)+string.len(Reason))+3)
elseif Sep == nil and Sep_2 ~= nil then
Reason="No Reason"
Name=string.sub(param,1,Sep_2-1)
Time=string.sub(param,Sep_2+1)
elseif Sep_2 == nil and Sep ~= nil then
Reason=string.sub(param,Sep+1)
Name=string.sub(param,1,Sep-1)
Time=10
else
Reason="No Reason"
Name=param
Time=10
end
Player=getPlayerByName(Name)
Server = string.lower(Server)
RealTime = Time*1000*60
p = {cid=cid,Name=Name,Server=Server,Time=RealTime,PosToGo=PosToGo,StVal=StorageValue}
if isPlayer(Player) == 1 then
if Server == 'tfs' then
check = getPlayerGroupId(cid); checking = GroupIdToUse
else
check = getPlayerAccess(cid); checking = AccessToUse
end
if check >= checking then
if Server == 'tfs' then
doTeleportThing(Player,wichJail(Jail),1)
broadcastMessage(''..getPlayerName(Player)..' was arrested by '..getPlayerName(cid)..'',19)
mayNotLogout(Player,1)
stopEvent(release)
release = addEvent(releasePlayer,RealTime,p)
else
doTeleportThing(Player,wichJail(Jail))
doPlayerSay(cid,''..getPlayerName(Player)..' was arrested by '..getPlayerName(cid)..'',9)
doPlayerSendTextMessage(cid,22,"Warning: Do not logout while in jail or you will suffer the consequences.")
setPlayerStorageValue(Player,StorageValue,os.time())
stopEvent(checking)
checking = addEvent(checkPlayer,1000*30,p)
end
doPlayerSendTextMessage(Player,22,"You have been arrested for: "..Reason..". You will return to your temple when you soned your punishment. Wich will be in "..Time.." minute(s).")
else
doPlayerSendCancel(cid,'Sorry, not possible.')
end
else
doPlayerSendCancel(cid,'A Player with this name is not online')
end
else
doPlayerSendCancel(cid,'Missing parameter: Playername.')
end
end
-----
function releasePlayer(p)
Player=getPlayerByName(p.Name)
if isPlayer(Player) == 1 then
doPlayerSendTextMessage(Player,22,"You\'ve done your time.")
if p.Server == 'tfs' then
doTeleportThing(Player,p.PosToGo,1)
mayNotLogout(Player,0)
else
setPlayerStorageValue(Player,p.StVal,0)
doTeleportThing(Player,getPlayerMasterPos(Player))
end
end
end
-------
function wichJail(Arr)
repeat Rand=math.random(1,#Arr)
until Arr[Rand].x ~= 0
return Arr[Rand]
end
------
function checkPlayer(p)
Player=getPlayerByName(p.Name)
--print('Checking...')
if isPlayer(Player) == 1 and os.difftime(os.time(),getPlayerStorageValue(Player,p.StVal)) >= (p.Time/1000) then
releasePlayer(p)
else
addEvent(checkPlayer,1000*30,p)
end
end
Te na czerwono trzeba zmienić. Wpisać gdzie jest 10 klatek, a niebieski to gdzie ma się tp po upływie kary.
a w talkactions.xml dodaj
<talkaction words="/jail" script="jail.lua" />
Działanie:
/jail "Nick,powód;czas
Ostatnio edytowany przez rici (2007-11-18 08:02:51)
Offline
Zbanowany
Offline