Witamy Na OTS Fans, Przeczytaj Regulamin lub Zarejestruj się.
I User
Autorem Jest NoName
Oryginalny Temat
1. w data\npc
utwórz plik: Cleaner.xml, a w nim umieść to:
<?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:
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:
<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