 |
OTS Red Castle Forum Red Castle
|
Zobacz poprzedni temat :: Zobacz następny temat |
Autor |
Wiadomość |
son_of_sillve
Miotacz Postów
Dołączył: 09 Kwi 2007
Posty: 167
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: Z Nienacka
|
Wysłany: Śro 19:26, 16 Maj 2007 Temat postu: Skrypt na więzienie z celarune (działa w carlin 7.6) |
|
|
ciekawy skrypcik.. dla Pita jak znalazł.. gotowy do odpalenia na Redzie.. pozycje poprawne:
w data/actions/scripts robimy plik celarune/lua i wklejamy ten texcik
Kod: |
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=730, y=597, z=7}
cela2={x=734, y=597, z=7}
doPlayerSendTextMessage(cid,22,"Wykryto obecnosc gracza")
rand = math.random(1,2)
if rand == 1 then
doTeleportThing(creature2.uid,cela1)
elseif rand == 2 then
doTeleportThing(creature2.uid,cela2)
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 |
następnie w data/npc robimy plik Straznik.xml i wklejamy to:
Kod: |
<?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> |
potem w data/npc/scripts robimy plik o nazwie Straznik.lua i wklejamy tą oto zawartość:
Kod: |
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 .. ', 703 600 7')
end
else
selfSay('Nastepnym razem zachowuj sie poprawnie to nie bedziesz siedzial calego dnia.')
selfSay('/send ' .. cname .. ', 703 600 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 = 725
pdx = 727
pgx = 727
lgx = 725
ldy = 595
pdy = 595
lgy = 594
pgy =594
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 |
do npc.xml dodajemy (dla carlin)
Kod: |
<npc name="Straznik" x="726" y="595" z="7"/> |
Post został pochwalony 0 razy
|
|
Powrót do góry |
|
 |
|
 |
|
|
Możesz pisać nowe tematy Możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach
|
fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2002 phpBB Group
|