OTS Fans

Witamy Na OTS Fans, Przeczytaj Regulamin lub Zarejestruj się.


#1 2011-04-17 07:07:08

Xelemeleque

I User

Zarejestrowany: 2011-04-14
Posty: 17
Punktów :   

Auto Clean

Autorem Jest NoName
Oryginalny Temat


1. w data\npc
utwórz plik: Cleaner.xml, a w nim umieść to:


Kod:

<?xml version="1.0"?>
<npc name="Cleaner" script="data/npc/scripts/cleaner.lua" access="5">
 	<look type="133" head="116" body="120" legs="131" feet="122"/>
</npc>

2. w data\npc\scripts
utwórz plik: cleaner.lua, a w nim umieść to:


Kod:

start = nil
clean = 0
focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
end

function onCreatureTurn(creature)
end

function onCreatureSay(cid, type, msg)
end

function onCreatureChangeOutfit(creature)
end


function onThink()
--(G*M*S) - (24*60*60)
-- G-godziny / M-minuty / S-sekundy

if start == nil then
start = os.time()
end

if (clean==0) and os.difftime (os.time(), start) >= (1*60*60) then
selfSay('/B Clean za 1 minute.')
clean = 1
start = os.time()
end

if (clean==1) and os.difftime (os.time(), start) >= (30) then
selfSay('/B Clean za 30 sekund.')
clean = 2
start = os.time()
end

if (clean==2) and os.difftime (os.time(), start) >= (20) then
selfSay('/B Clean za 10 sekund.')
clean = 3
start = os.time()
end

if (clean==3) and os.difftime (os.time(), start) >= (7) then
selfSay('/B Clean za 3 sekundy.')
clean = 4
start = os.time()
end

if (clean==4) and os.difftime (os.time(), start) >= (1) then
selfSay('/B Clean za 2 sekundy.')
clean = 5
start = os.time()
end

if (clean==5) and os.difftime (os.time(), start) >= (1) then
selfSay('/B Clean za 1 sekunde.')
clean = 6
start = os.time()
end

if (clean==6) and os.difftime (os.time(), start) >= (1) then
selfSay('/clean')
clean = 0
start = nil
end

end

3. w data\world w pliku npc.xml
dodaj między innymi linijkami:

Kod:

<npc name="Cleaner" x="666" y="257" z="7"/>

Tłumaczenie:
11*60*60 - 1 razy 60 razy 60 sekund co daje nam 1 godzinę liczoną od włączenia serwera. Po jej upływie NPC poinformuje o cleanie i po kolejnej minucie zrobi clean'a.
x="666" y="257" z="7" - pozycja tego NPC na mapie (najlepiej niedostępna dla graczy)

Offline

 

Stopka forum

RSS
Powered by PunBB 1.2.23
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi

[ Generated in 0.009 seconds, 7 queries executed ]


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.k800icentrum.pun.pl www.narutek.pun.pl www.ricoe.pun.pl www.h2osok.pun.pl www.zrom.pun.pl