Wiezienie

Status
Zamknięty.

luksonik

Advanced User
Zarejestrowany
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
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} --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
teraz NPC Ktory nas informoje ile czasu bendziemy siedziec
<?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 dada/npc/scripts dajemy
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
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
-xxx xxx x to gdzie teleportuje nasz npc
w actions dodajemy <action itemid="2297" script="wienzien.lua" />
i to end:D:cool:
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:
Odp: Wienzienie xD [lua]

Odp: Wienzienie xD [lua]

Widze b?ad mianowicie nie lya tylko lua,ale skrypt fajny!
 
Odp: Wienzienie xD [lua]

Odp: Wienzienie xD [lua]

Sorki xD tam ma byc lua za szybko to pisalem xD:o:cool:
 
Odp: Wienzienie xD [lua]

Odp: Wienzienie xD [lua]

oj cz?owiek szybko pisa? xD to par? b??d?w zrobi? :p scrypta zaraz wytestuj? :cool:
 
Odp: Wienzienie xD [lua]

Odp: Wienzienie xD [lua]

To Jest cz?owiek kt?ry kocha tibie na zab?j!

Pisze skrypty. A do szko?y by mo?e si? posz?o nawet w temacie b??d.
|
\/

JA BY?EM W SZKOLE!

Wienzienie? Nie <nie>
Wi?zienie O,Tak! <tak>
 
Odp: Wienzienie xD [lua]

Odp: Wienzienie xD [lua]

Skrypt bardzo si? przyda do ka?dego OTS...
Ale ja widzia?e? b??d to chyba go poprawisz-.-
Do tego twoja ortografia... Chyba wsz?dzie gdzie mog?e? zrobi?e? b??d :o
 
Odp: [lua] Wienzienie xD

Odp: [lua] Wienzienie xD

stzalow << a nie strza??w??:D
 
Odp: Wienzienie

Odp: Wienzienie

Nie dada , tylko data .
xDDD

@topic nie mam zdania co do tego skryptu

Weso?ych ?wi?t i Szcz??liwego Nowego Roku .

Pozdrawiam
 
Odp: Wienzienie

Odp: Wienzienie

No wi?c tak: skrypt w 0 % tw?j. Tyle powiem. Widzia?em go gdzie?. GM Maciej? Dziwne. Poza tym du?o b??d?w ort. i int.

Ocena:
Skrypt: 8/10
Twoja: -1/10

Pozdro,
Gelio
 
Odp: Wienzienie

Odp: Wienzienie

bardzo przydatny skrypt chocia? jest ju? bardzo du?o tego typ?w skrypt?w
 
Odp: Wienzienie

Odp: Wienzienie

Co ty tu zmieni?e??? Ani look type, ani text co gada... Tak jak powiedzia? kolega 2x UP, ten skrypt nie jest tw?j ani Ty nic do niego nie doda?e?. Jest to zwyk?y plagiat, a w tym dziale na pewno si? znajdzie jeszcze jeden taki temat.

Skrypt spoko, ale ty go nie zrobi?e?...
 
Odp: Wienzienie

Odp: Wienzienie

Kurde no jak to czyta?em to si? wnerwi?em:/ Czepiacie sie go a sami lepiej nie piszecie, a co do skryptu to fajny 10/10
 
Odp: Wienzienie

Odp: Wienzienie

Skrypt przydatny, a ortografia zajebista ; ). Idz cz?owieku do szko?y, a potem zabierz si? za skrypty. Jak to czyta?em spad?em z krzes?a ; ).
 
Odp: Wienzienie

Odp: Wienzienie

@up

A ja spad?em z krzes?a jak zobaczy?em tw?j nick...

A co do skryptu, sam wykorzystam go na swoim ot Moja ocena 7/10 :D

Kopiuj?c skrypt Autora by? napisa? ... :eek:
 
Odp: Wiezienie

Zal no i co ze pomylil sie w kilku zdaniach ale zrobcie taki skrypt jak on powinny byc same pozytywy .. -.-, nie wszyscy tak potrafia
 
Odp: Wiezienie

Dzi?ki za ten skrypt :D dzia?a tylko nie umiem ustawi? ?eby si? porusza? ;/ Pomo?esz ? :) pw lub gg: 3357420 lol
 
Odp: Wiezienie

Du?o b??d?w, bardzo brzydko napisane Xd.
Daje poprawke:
W Data/Actions dodajemy plik wiezienie.lua i wpisujemy:
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} --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.")
else
doPlayerSendCancel(cid,"Pudlo.")
end
else
doPlayerSendCancel(cid,"Idz z tym przedmiotem do GameMastera, aby dostac odpowiednia nagrode.")
end
return 1
end
Teraz NPC - Data/NPC dodajemy plik Straznik.xml a w nim:
<?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/Scripts tworzymy plik Straznik.lua a w nim:
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
UWAGA!!
linijki:
ldx = 157
pdx = 166
pgx = 166
lgx = 157
ldy = 237
pdy = 237
lgy = 225
pgy =225
nale?y sobie ustawi? wed?ug:
pd = prawy dolny
pg = prawy g?rny
ld = lewy dolny
lg = lewy g?rny
To jest to po czym b?dzie sie porusza? npc (musz? by? wierzcho?ki prostok?ta lub kwadratu)(to sala g??wna)
Uwaga!!!
-npc musi si? znajdowa? na jednym z wierzcho?k?w lub na trasie inaczej nici z poruszania si?
-xxx xxx x to gdzie teleportuje nas npc


W Actions.xml dodajemy:
<action itemid="2297" script="wienzien.lua" />
I to na tyle, radze tw?j scrypt podmieni? na ten, jest on bardziej czytelny i estetyczny.
Regards,
~v3k.
 
Status
Zamknięty.
Back
Do góry