Forum Zostalo Stworzone By Pomagać Ludzią W Grze Tibia Ots
Wchodzimy w data/actions/scrpits trzeba zrobić notatnik , a w nim wpisujemy:
if (tibiantime == false) then
if (twentyfour == true) then
time = os.date('%H:%M')
else
time = os.date('%I:%M %p')
end
else
time = rl2tib(os.date('%M'), os.date('%S'), twentyfour)
end
doPlayerSendTextMessage(cid, 22, "The time is "..time..".")
return 1
end
function rl2tib(min, sec, twentyfour)
--zegarek - by Apitov (7.6)
suffix = ''
varh = (min*60+sec)/150
tibH = math.floor(varh) -- hour!
tibM = math.floor(60*(varh-tibH)) -- minute!
if (twentyfour == false) then
if (tonumber(tibH) > 11) then
tibH = tonumber(tibH) - 12
suffix = ' pm'
else
suffix = ' am'
end
if (tibH == 0) then
tibH = 12
end
end
if (tibH < 10) then
tibH = '0'..tibH
end
if (tibM < 10) then
tibM = '0'..tibM
end
return (tibH..':'..tibM..suffix)
end
Zapisujemy jako: watch.lua
Przechodzimy w data/actions/actions.xml
Dodajemy linijkę:
<action itemid="2036" script="watch.lua" />
Offline