- Dołączył
- Kwiecień 11, 2008
- Posty
- 273
- Liczba reakcji
- 21
Mam wam do przedstawienia skrypt na zwykle wienzienie polega na walnienciu w playera runkom o id:2297 ilosc stzalow decyduje ile min spendzi nasz player w wienzieniu (runa sie nie konczy xD to zaczynamy:
Data/Actions/Wienzien.lya dajemy
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
-xxx xxx x to gdzie teleportuje nasz npc
w actions dodajemy <action itemid="2297" script="wienzien.lua" />
i to end

P.S. Skrypt nie w pelni jest moj czyli tylko to na runke jest moje npc znalazlem i troche go podrasowalem xD
/Poprawiono tagi
//Prefiks dodany.
Data/Actions/Wienzien.lya dajemy
teraz NPC Ktory nas informoje ile czasu bendziemy siedziecfunction 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} --cela1
cela2={x=152, y=225, z=8} --cela2
cela3={x=154, y=237, z=8} --cela3
cela4={x=161, y=242, z=8} --cela4
cela5={x=170, y=236, z=8} --cela5
cela6={x=170, y=230, z=8} --cela6
cela7={x=169, y=223, z=8} --cela7
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
a w dada/npc/scripts dajemy<?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>
UWAGA!!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 .. ', xxx xxx x')
end
else
selfSay('Nastepnym razem zachowuj sie poprawnie to nie bedziesz siedzial calego dnia.')
selfSay('/send ' .. cname .. ', xxx xxx x')
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
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
-xxx xxx x to gdzie teleportuje nasz npc
w actions dodajemy <action itemid="2297" script="wienzien.lua" />
i to end


P.S. Skrypt nie w pelni jest moj czyli tylko to na runke jest moje npc znalazlem i troche go podrasowalem xD
/Poprawiono tagi
//Prefiks dodany.
Ostatnio edytowane przez moderatora:

scrypta zaraz wytestuj?
pw lub gg: 3357420 lol