Odp: [Lua] Exhausted i Dzielenie liczb(czasu)
spr?buj wrzuci? sobie to, ostrzegam nie testowane:
[LUA]function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 34239
local exhausted_seconds = 43200 --- ustawiasz co ile mozna
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds *60)
doPlayerSendCancel(cid, "Mozesz uzyc Exp Scrolla tylko co 12H")
doPlayerSendTextMessage(cid,MESSAGE_STATUS_SMALL,"Mozesz uzyc tylko co 12H. Nastepne uzycie za ".. cid,MESSAGE_STATUS_SMALL,"Mozesz uzyc tylko co 12H. Nastepne uzycie za ".. setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds *60)..."
return 0
end
exhaustion.set(cid, storage, exhaustionInSeconds)
if getPlayerStorageValue(cid,1301) == 2 then
doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 8 then
doCreatureSay(cid, "You Gained 80 000 000 Experience Points!", TALKTYPE_ORANGE_1)
doPlayerAddExp(cid, 80000000)
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
return TRUE
else
doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
end
end
end[/LUA]
Je?li skrypt zadzia?a a * nie b?dzie chcia?o chodzi? spr?buj z / : P a je?li nie to nie wiem ^ ^"