Nie tylko o Tibii i OTS...
W data<actions<scripts twozymy stoper.lua
--- stoper by new hero ---
function onUse(cid, item, frompos, item2, topos)
stoper = getPlayerStorageValue(cid,16)
if stoper == 0 or stoper == -1 then
setPlayerStorageValue(cid,13,os.date('%H'))
setPlayerStorageValue(cid,14,os.date('%M'))
setPlayerStorageValue(cid,15,os.date('%S'))
setPlayerStorageValue(cid,16,666)
doPlayerSay(cid,"Start",16)
elseif stoper == 666 then
godzina = getPlayerStorageValue(cid,13)
minuta = getPlayerStorageValue(cid,14)
sekunda = getPlayerStorageValue(cid,15)
tgodzina = os.date('%H')
tminuta = os.date('%M')
tsekunda = os.date('%S')
ilebh = godzina*3600
ilebm = minuta*60
ilebs = sekunda
ileth = tgodzina*3600
iletm = tminuta*60
ilets = tsekunda
ilesekundbylo = ilebh + ilebm + ilebs
ilesekundjest = ileth + iletm + ilets
uplynelo = ilesekundjest - ilesekundbylo
if uplynelo >= 3600 then
xxxst = uplynelo/3600
setPlayerStorageValue(cid,13,xxxst)
xxx = getPlayerStorageValue(cid,13)
yyx = uplynelo - xxx
yxxst = yyx/60
setPlayerStorageValue(cid,14,yxxst)
yxx = getPlayerStorageValue(cid,14)
yyy = yyx - yxx
elseif (uplynelo >= 60) and (uplynelo <= 3599)then
xxx = 0
yxxst = uplynelo/60
setPlayerStorageValue(cid,14,yxxst)
yxx = getPlayerStorageValue(cid,14)
zzz = yxx*60
yyy = uplynelo - yxx
elseif uplynelo <= 59 then
xxx = 0
yxx = 0
yyy = uplynelo
end
doPlayerSendTextMessage(cid,22,"Stoper zatrzymany na: "..xxx..":"..yxx..":"..yyy.."")
setPlayerStorageValue(cid,16,555)
doSetItemSpecialDescription(item.uid,"stoper. Pokazuje: "..xxx..":"..yxx..":"..yyy.."")
elseif stoper == 555 then
setPlayerStorageValue(cid,16,0)
setPlayerStorageValue(cid,13,0)
setPlayerStorageValue(cid,14,0)
setPlayerStorageValue(cid,15,0)
doSetItemSpecialDescription(item.uid,"stoper")
doPlayerSay(cid,"Wyzerowano licznik !!!!",16)
end
return 1
end
Nastepnie w data<actions (actions.xml) :] dodajemy linijke : <action itemid="2036" script="stoper.lua" />
aby wlaczyc stoper naciskamy raz aby zatrzymac i zobaczyc raz tez naciskamy raz i look aby wyzerowac trzeba 3 razy dac use i to tyle mam nadzieje ze sie spodoba :]
I LICZE NA REPUTA XD
AHA ID NA STOPER TO /i 2036 1
CZYLI ZEGAREK NA RĘKĘ xD
Ostatnio edytowany przez new hero (2007-09-25 22:07:18)
Offline
Offline
Zbanowany
Offline
Zbanowany
Offline
Sułtan łechtaczek
Było i to daaaaaaaaaaaawno
Offline